How to Deploy CDK Stacks Across Multiple AWS Accounts Without Direct Access?

0

Hello everyone,

We are developing with CDK in TypeScript and have multiple stacks that include Lambdas, App Runners, S3 buckets, etc. We also have an Organization account that we have access to. Currently, each new customer gets their own account via a Lambda function, so no manual work is needed.

Now, the problem is that I want to deploy the entire setup we created with CDK into each new customer account. I figured I could use Step Functions with Lambda to trigger CloudFormation on the new accounts. However, the issue is that we don't have direct access to these accounts, so I cannot run cdk bootstrap or cdk deploy.

What would be the best way to solve this? My idea, as mentioned, is to use Step Functions with Lambdas and upload the templates created in the cdk.out folder to our Organization account's S3 bucket, then deploy from there. However, these IaC files reference assets and other resources. What is the best way to modify these references, or am I heading in the completely wrong direction?

Greetings, Marko

1 Answer
1

You can use CloudFormation StackSets to automatically bootstrap new accounts as soon as they are created.

Have a look at this blog post which provides a thorough walkthrough of how you can do that.

profile pictureAWS
EXPERT
answered a month ago
  • Thank you. I gonna check this out. What about resources? Lambdas, etc.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions