aws-cdk: (cli): deploy stack with --parameters option specifying stack is ignored (MyStack:Parameter="Value")
When using the cdk deploy option cdk deploy '*' --parameters MyStack:MyParam=MyValue the parameter will be ignored.
Reproduction Steps
- Create a multi stack application, where you use a parameter in only one of the multiple stacks.
- Use the option
cdk deploy '*' --parameters MyParam=MyValuewill fail, because only one stack needs the parameter:Parameters: [MyParam] do not exist in the template - Use the option
cdk deploy '*' --parameters MyStack:MyParam=MyValuewill fail, because the stack needing the parameter says:The following CloudFormation Parameters are missing a value: MyParam
What did you expect to happen?
I expected that cdk can handle passing a parameter to only one stack. This behaviour is described here: https://docs.aws.amazon.com/cdk/latest/guide/parameters.html
What actually happened?
you can only pass parameters to all, or no stack
Environment
- CDK CLI Version : 1.79.0
- Framework Version: 1.79.0
- Node.js Version: 12.18.4
- OS : mac
- Language (Version): TypeScript
This is 🐛 Bug Report
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 16 (9 by maintainers)
For anyone else experiencing this issue, the problem is the documentation isn’t very clear. The stack name is the value in
stackNameproperty (or what the stack name in Cloudformation will be), not the construct ID. So, if your stack name in CFN ismystack-dev, the parameter will bemystack-dev:Parameter=Value, notMyStack:Parameter=ValueAny updates on this? I’m having the same problem.