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

  1. Create a multi stack application, where you use a parameter in only one of the multiple stacks.
  2. Use the option cdk deploy '*' --parameters MyParam=MyValue will fail, because only one stack needs the parameter: Parameters: [MyParam] do not exist in the template
  3. Use the option cdk deploy '*' --parameters MyStack:MyParam=MyValue will 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)

Most upvoted comments

For anyone else experiencing this issue, the problem is the documentation isn’t very clear. The stack name is the value in stackName property (or what the stack name in Cloudformation will be), not the construct ID. So, if your stack name in CFN is mystack-dev, the parameter will be mystack-dev:Parameter=Value, not MyStack:Parameter=Value

Any updates on this? I’m having the same problem.