Ability to deploy to multiple accounts and mention the assume role in the main app.py
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?
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
Seems to be a duplicate of #3401
Closing in favor of #3401 .