aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

Ability to deploy to multiple accounts and mention the assume role in the main app.py

Open chandrakanthkannam opened this issue 7 years ago • 3 comments

I'm using CDK version 1.2.0, I'm trying to do a deployment to all the accounts present in our organization. I was able to put in all the target account numbers and regions in the app like this( i used the loop as we have almost 30+ accounts):

for account in account_numbers: if account is not None: MyStack(app, f"account-{account[0]}", env={'account':account[0],'region': 'us-east-1'})

CDK was able to synth all the templates, while deploying i tried to deploy with a single command using the wild card ability.

cdk deploy account-*

and it failed as the default profile which was for account-1 and deploy failed to apply to account-2. So my question here is, can we deploy these kind of scenarios in an better way instead of typing in command for 30+ times for each account with each profile seperatly?

chandrakanthkannam avatar Jul 31 '19 19:07 chandrakanthkannam

I'm looking for something quite similar.

We have a "root" account, and multiple "stage" accounts. Currently, we have to deploy each account separately, instead of the specified "env" in the stack actually being used.

It's not a big thing for us, since we only have ~6 accounts, but it's still annoying. Especially when you have to manually add references from the root->stage stacks

ApocDev avatar Aug 02 '19 16:08 ApocDev

Seems to be a duplicate of #3401

tader avatar Aug 05 '19 11:08 tader

Closing in favor of #3401 .

skinny85 avatar Feb 06 '20 23:02 skinny85