You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like the title says, if you specify a stack inside a StackSetStack, then the Stack doesn't get deployed. (or it can, using the --all flag but then it only gets deployed to the primary region as its own stack and not all target regions).
Here is an example of code that works for deploying a bucket to all regions:
const app = new App();
const stack = new Stack(app);
const stackSetStack = new StackSetStack(stack, "StackSetStack");
new Bucket(stackSetStack, "Bucket");
new StackSet(stack, 'StackSet', {
target: StackSetTarget.fromAccounts({
regions: ['eu-west-1', 'eu-west-2'],
accounts: [process.env.CDK_DEFAULT_ACCOUNT!],
}),
template: StackSetTemplate.fromStackSetStack(stackSetStack),
});
As expected this deploys all the resources (a bucket in this case) to all the regions.
However, if you add a stack between the bucket and the StackSetStack, it no longer deploys the bucket to the all regions, e.g.
const app = new App();
const stack = new Stack(app);
const stackSetStack = new StackSetStack(stack, "StackSetStack");
const subStack = new Stack(stackSetStack, "SubStack");
new Bucket(subStack, "Bucket");
new StackSet(stack, 'StackSet', {
target: StackSetTarget.fromAccounts({
regions: ['eu-west-1', 'eu-west-2'],
accounts: [process.env.CDK_DEFAULT_ACCOUNT!],
}),
template: StackSetTemplate.fromStackSetStack(stackSetStack),
});
My expected behaviour would be that this deploys the stack to all regions and all regions subsequently deploy a bucket.
Please correct me if I'm wrong.
The text was updated successfully, but these errors were encountered:
This works the same way as with regular stacks - instantiating a Stack in the scope of a Stack doesn't result in a Nested stack - both are deployed in parallel. You need to use NestedStack explicitly instead.
Like the title says, if you specify a stack inside a StackSetStack, then the Stack doesn't get deployed. (or it can, using the
--all
flag but then it only gets deployed to the primary region as its own stack and not all target regions).Here is an example of code that works for deploying a bucket to all regions:
As expected this deploys all the resources (a bucket in this case) to all the regions.
However, if you add a stack between the bucket and the StackSetStack, it no longer deploys the bucket to the all regions, e.g.
My expected behaviour would be that this deploys the stack to all regions and all regions subsequently deploy a bucket.
Please correct me if I'm wrong.
The text was updated successfully, but these errors were encountered: