Closed akefirad closed 2 years ago
Hey @akefirad, Customizations for Control Tower has a hard dependency on StackSets, and the CloudFormation Stacks deployed follow a naming scheme of "StackSet-CustomControlTower-$STACKNAME-$GUID" where $STACKNAME is defined by the value to the name
key in the manfiest for a resource. Are you looking for further customization here?
Well the requirement on CDK side is to name the bootstrap stack exactly CDKToolkit
, otherwise you have to always give the stack name every time you run a CDK command. There might be a way to set this globally but the GUID thingy makes it impossible. So ideally I want to name the stack exactly CDKToolkit
, if not possible, drop the GUID. If not possible then I guess it's not possible to manage CDK bootstrap stack using CfCT. Any thought? Thanks.
Since CfCT relies on StackSets to deploy, dropping GUIDs is not possible with the current implementation.
CDK manages the lifecycle of it's bootstrap stacks as updates are published, currently it is not recommend to use CfCT to manage the CDK bootstrap stacks as it doesn't account for the updates of these stacks. I would recommend opening a feature request with AWS CDK
Interestingly I tried this setup (CDK bootstrap stack managed by CfCT) and managed to deploy the application stack (via CDK cross account pipeline). I just needed to set tookitStackName
(of the CDK stack in the CICD account) in cdk.json
of the project. It seems the pipeline doesn't need to know anything about the CDK stack in the workload account.
I'll reach out to CDK team and see what's their recommendation. Thanks.
Just to clarify, CfCT doesn't explicitly prevent management of the CDK Bootstrap stacks, and as you noted it should work. The issue becomes management of the lifecycle of those stacks. Going to go ahead and close this issue for now, thanks @akefirad!
Just for record, here's an excerpt from the AWS CDK documentation (emphasis mine):
Thus, you can bootstrap in one of two ways:
- Use the AWS CDK Toolkit's cdk bootstrap command. This is the simplest method and works well if you have only a few environments to bootstrap.
- Deploy the template provided by the AWS CDK Toolkit using another AWS CloudFormation deployment tool. This lets you use AWS CloudFormation Stack Sets or AWS Control Tower as well as the AWS CloudFormation console or the AWS CLI. You can even make small modifications to the template before deployment. This approach is more flexible and is suitable for large-scale deployments.
Is your feature request related to a problem? Please describe. To prevent XY problem, here's my use case. I'm trying to manage CDK bootstrap stacks for all accounts in CfCT. But the problem is that CDK needs to know the bootstrap stack name. There are ways to give the name while running the command, but I think it gets too complicated when it comes to cross-account deployment. Now, the current implementation of CfCT uses stack-sets to deploy stacks to accounts (correct me if I'm wrong). And AFAIK, this way, it's not possible to set a proper name for stack instances.
Describe the feature you'd like To be able to deploy stacks to accounts with a custom name.
Thanks.