2 ms·
I do multiple stacks via changing the state file based off of env: constructor(scope: Construct, name: string, c: StackConfig) { super(scope, name);
by tonyhb 5y ago
I do multiple stacks via changing the state file based off of env:
constructor(scope: Construct, name: string, c: StackConfig) {
super(scope, name);
new S3Backend(this, {
bucket: "some-bucket-here",
key: c.name("state-env"),
region: "" // wherever
});
}
// ... at the bottom of main
new Stack(app, 'something-something-dev', { environment: "dev", name: (i) => `${i}-dev` });
new Stack(app, 'something-something-prod', { environment: "prod", name: (i) => `${i}-prod` });
Then you can use stacks properly.