Deploying multiple stages to different accounts
I have a simple application that I would like to deploy in two stages to a dev and a prod account.
The generated workflow creates asset publishing jobs that try to deploy the shared assets to two different accounts, e.g.:
cdk.out/publish-Assets-FileAsset2-step.sh
set -ex
npx cdk-assets --path "cdk.out/assembly-Dev/DevSampleComponent408C8649.assets.json" --verbose publish "b46c69876cded265976e982f147d1783eeb5ba986b2668164e3f8c65113601ed:1234567890-eu-central-1"
npx cdk-assets --path "cdk.out/assembly-Prod/ProdSampleComponent911303F5.assets.json" --verbose publish "b46c69876cded265976e982f147d1783eeb5ba986b2668164e3f8c65113601ed:0987654321-eu-central-1"
Currently, the credentials either have permission to publish to one or the other account, but not both.
Is this a valid use case? How is this supposed to work?
~~@christophgysin were you able to find a solution for this? I have the same issue where I try to deploy to multiple accounts. Asset publishing fails with:~~
error : [100%] fail: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
Failure: CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
~~Even though the role should have permission to assume the file-publishing role in the other accounts. I looked into the source code of cdk-assets a bit and couldn't find where it tries to assume that role. Maybe that's the issue? In fact for me it won't even publish assets to the same account where the role is from, suggesting it truly doesn't try to assume the other role.~~
It actually works fine for me. I messed up the role assumption permissions.