worried-church-46455
08/17/2021, 1:40 AMconfig:
aws:rds:Instance:
engine: "mysql"
instance_type:
dev: "db.t2.micro"
prod: "db.t2.xlarge"
I can do some codegen myself to regroup my new configuration format and separate it into .dev.yml & .prod.yml.
Do you guys see any obvious cons with this step up? Is it possible to customize this behavior with in pulumi?little-cartoon-10569
08/17/2021, 1:52 AMworried-church-46455
08/17/2021, 2:16 AMThat won’t work well in per-user stack setup. Teams where everyone has their own stack.Ah good point! That sounds like a pretty common use case.
You want all stacks to be configured via a single file?Yes. For my use case though, there will only be 3 stacks at most: dev, staging, and prod. With 3 .yml files, it’s a bit hard to see what are the differences among those envs.
little-cartoon-10569
08/17/2021, 2:20 AMworried-church-46455
08/17/2021, 2:52 AMMaybe you could put it all in a new .yaml, and write a script that creates your Pulumi.yaml and all stack files from it?Yep! I think I might do that. It should worth the effort. Do you see any potentials for pulumi to: 1. pulumi itself supports different config formats 2. it accepts some plugin or some-sort to allow user customize their configurations?
little-cartoon-10569
08/17/2021, 3:15 AMbrave-planet-10645
08/17/2021, 7:38 AMexport const config = {
rdsInstance: {
engine: "mysql",
instanceType: {
dev: "db.t2.micro",
prod: "db.t2.xlarge"
}
}
};
You can also include some stack config in there too, so you can include secrets in it:
import * as pulumi from "@pulumi/pulumi";
const pulumiconfig = new pulumi.Config();
export const config = {
rdsInstance: {
engine: "mysql",
instanceType: {
dev: "db.t2.micro",
prod: "db.t2.xlarge"
},
username: "root",
password: pulumiconfig.getSecret("mysqlpassword")
}
};
worried-church-46455
08/18/2021, 12:25 AM