Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cli): deploy stack with --parameters option specifying stack is ignored (MyStack:Parameter="Value") #12759

Closed
markussiebert opened this issue Jan 28, 2021 · 16 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p1 package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@markussiebert
Copy link
Contributor

markussiebert commented Jan 28, 2021

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

@markussiebert markussiebert added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 28, 2021
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jan 28, 2021
@ghost
Copy link

ghost commented Feb 1, 2021

To me, this feels like it should be a warning instead of an error.

@master7811
Copy link

Huh? For me I think it should work as described in the documentation. Even nowing parameters are somehow deprecated, it is the only way getting secrets into custom resources.
So I consider this as a bug.

@rix0rrr rix0rrr added p1 effort/medium Medium work item – several days of effort labels Feb 8, 2021
@ryparker ryparker removed the needs-triage This issue or PR still needs to be triaged. label Jun 1, 2021
@mitchboulay
Copy link

Hi, I'm getting this also. I am building a parameters argument and passing it to the CLI in Github actions. I get the error "CdkStack failed: Error: The following CloudFormation Parameters are missing a value: uploadbucketname"

@github-actions
Copy link

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Dec 22, 2022
@markussiebert
Copy link
Contributor Author

still not fixed?

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Dec 22, 2022
@tdluk
Copy link

tdluk commented Mar 17, 2023

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

@anigenero
Copy link

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

@nickyshankar
Copy link

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

@SankyRed SankyRed self-assigned this May 2, 2024
@SankyRed
Copy link
Contributor

SankyRed commented May 2, 2024

It appears that the reported issue has been resolved. The version in use, which is v1, is deprecated. I conducted tests on the feature utilizing version v2.138.0. During testing, I replicated the scenario by creating multiple stacks, with only one stack necessitating parameters. Subsequently, I executed the deployment of all stacks using the command cdk deploy --all --parameters StackWithParameter:BucketName=uploadbucket3456, and the deployment proceeded successfully. As a result, I am closing the issue. If you have any further inquiries or concerns, please feel free to reach out.

@SankyRed SankyRed closed this as completed May 2, 2024
Copy link

github-actions bot commented May 2, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@SankyRed
Copy link
Contributor

SankyRed commented May 3, 2024

I have recreated a similar scenario comprising multiple stacks, with one stack necessitating parameters that can be passed on during the deployment.

Steps taken to check if the issue works:

> cdk ls // listing stacks
- MultiStackCdkAppStack
- StackWithoutParameter
- StackWithParameter

Of the list of the stacks displayed above StackWithParameter requires bucketName as the parameter and if not passed on while deploying we have a default set as well.

Running cdk deploy --all or cdk deploy '*'. Deploys all the three stacks with the default bucket name.

Running cdk deploy '*' --parameters StackWithParameter:BucketName=uploadbucket3456 deploys the stacks successfully.
Screenshot 2024-05-03 at 1 17 12 PM
Screenshot 2024-05-03 at 1 57 53 PM

Also, tested the feature with hierarchal structure and works successfully.

Steps taken to check if it works:

> cdk ls // listing stacks
- MultiStackCdkAppStack
- MultiStackCdkAppStack/StackWithoutParameter
- MultiStackCdkAppStack/StackWithParameter

Running cdk deploy --all or cdk deploy '**'. Deploys all the three stacks.

Running cdk deploy '**' --parameters MultiStackCdkAppStack/StackWithoutParameter:BucketName=uploadbucket3456 deploys the stacks successfully.

Also tested it using the --all flag instead of '*' and that works as well.

As per the request it seems like we can deploy all stacks passing in parameters for specific stacks.

Environment
CDK CLI Version : 2.138.0
Node.js Version: 18.19.1
OS : mac
Language (Version): TypeScript

@markussiebert Can you please specify if the issue exists on your end?

@vinayak-kukreja vinayak-kukreja added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 6, 2024
Copy link

github-actions bot commented May 6, 2024

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 6, 2024
@SankyRed
Copy link
Contributor

SankyRed commented May 6, 2024

@nickyshankar @tdluk Hello, I'm checking to see if the issue still persists on your end? Can anyone please confirm if the issue persists and also if you could please specify the environment it would be helpful.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels May 7, 2024
@tdluk
Copy link

tdluk commented May 7, 2024

@nickyshankar @tdluk Hello, I'm checking to see if the issue still persists on your end? Can anyone please confirm if the issue persists and also if you could please specify the environment it would be helpful.

Works fine for me. My problem was I was using the stack's construct ID instead of the stack name. This comment made things clear for me -> #12759 (comment)

@SankyRed SankyRed added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 7, 2024
Copy link

github-actions bot commented May 9, 2024

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels May 9, 2024
@evzzk
Copy link
Contributor

evzzk commented May 17, 2024

We've updated our documentation to provide clarification on this issue. For more information, see Deploying with parameters in the AWS CDK Developer Guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p1 package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests