cdk-multi-profile-plugin
cdk-multi-profile-plugin copied to clipboard
Does not work with CDK 1.51.0
The plugin apparently does no longer work with CDK 1.51.0 onwards.
cdk.json
:
{
"app": "npx ts-node bin/infra.ts",
"context": {
"@aws-cdk/core:enableStackNameDuplicates": true,
"aws-cdk:enableDiffNoFail": true,
"@aws-cdk/core:newStyleStackSynthesis": true
},
"plugin": ["cdk-multi-profile-plugin"]
}
cdkmultiprofileplugin.json
{
"awsProfiles": {
"1111111111": "1111111111_AWSAdministratorAccess",
"2222222222": "2222222222_AWSAdministratorAccess",
"3333333333": "3333333333_AWSAdministratorAccess",
"4444444444": "4444444444_AWSAdministratorAccess"
}
}
Running yarn cdk deploy PipelineStack
fails with the message:
$ cdk deploy PipelineStack
🚀 Using profile 1111111111_AWSAdministratorAccess for account 1111111111 in mode ForReading
Could not assume role in target account (did you bootstrap the environment with the right '--trust's?): The security token included in the request is invalid
error Command failed with exit code 1.
Specifying --profile
manually works without any issues
yarn cdk deploy PipelineStack --profile 1111111111_AWSAdministratorAccess
aws/aws-cdk#11350