-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
cloudformation deploy fails if new parameters are not overridden even if they have default value #2599
Comments
Thanks for the report, this seems to be related to a previous bugfix: #2573 |
Its not a regression to previous bugfix, but a new corner case that the code doesn't handle well. Unfortunately, this is a tough one because I need to pull down the latest template from stack, parse parameters, diff with the new template and merge current-template, new-template and overrides to come up with list of accurate UsePreviousValues. For the majority use-case, this extra call is unnecessary. Potential fix would be to use Until we fix this bug, you can override the parameter explicitly when you add a new parameter with default value. Just once when you first update the stack. Afterwards, UsePreviousValue should work as expected |
This is still an issue as of awscli version 1.11.146. |
Just say you are adding ServiceCount, do it this way: aws cloudformation deploy --template-file ./build/cfn-package.yml --stack-name dev-v2 --region us-west-2 --capabilities CAPABILITY_NAMED_IAM CAPABILITY_IAM --parameter-overrides ServiceCount=1 |
In the modern world of infrastructure creates/updates happening via CI or some other automation one-time hacks to put the new parameter there really don't cut it. |
Just adding another voice here. This isn't a "corner case." The way this currently works doesn't play nice with CI at all, and it's something I have to hack around with manual workarounds on a regular basis. Using the default if no previous value exists should be the expected behavior. |
Shameless plug for #2943 which provides a alternate mode of operation (never re-use stack params because that's a deployment anti-pattern IMO) and thereby avoids this problem. I realise this won't be satisfactory for everyone but I thought I'd mention it. |
btisdall: this is not the same thing. I agree that we should not re-use stack params, but the default should work, and we should not have to override them. |
I actually disagree. I think reusing params is extremely handy. No way would I want to have to specify every single parameter every time I wanted to re-deploy. Sure, in a CI/CD environment that would probably make sense. But often times I'm running build & deploy from the command line. |
In particular when doing stack updates, where you might not be aware of all the parameters that were set at creation time. We currently have scripts for updates which pull all of the original parameters from the stack and then override the ones we're changing to prevent things like regression to defaults, but it would be nice to not have to do that. Also because of the behavior cited here adding a parameter to a stack means breaking any code/procedure/deployment that does not know about the new parameter. That would make sense if the parameter did not have a default, but that's what defaults are supposed to do: make a selection when none is provided by the user. |
@billnbell and others: I'm fully aware it's not the same thing, I thought my comment made this clear. I absolutely agree that new template params with a default should just work with the command as it is. And I don't deny parameter re-use is handy, I just happen to think it's a bad choice for some situations because you're effectively pushing your infrastructure configuration out of code into a remote system. |
👍 Any news on this? |
Ran into this same issue today. |
same issue here, any updates? |
Same problem here :/ |
…ters don't set UsePreviousValue if parameters doesn't exist (fixes #2599)
* release-1.14.31: Bumping version to 1.14.31 Update changelog based on model updates Fixing broken test caused by a merge of PR #2659 Removing stray print statement CloudFormation deploy tags should be in key=value format Fix tests fix error where tags are not being passed to create_change_set updated tests to handle new parameter Updated example command to include new tag argument Added Cfn stack tag support to the deploy command don't set UsePreviousValue if parameters doesn't exist (fixes #2599)
This is still an issue with Cloud9 Lambda functions. It's not possible to add a parameter to the SAM template file. And the click-to-deploy functionality does not offer a way to fix it via the command line. |
aws/aws-cli#2599 we can remove these lines later.
bug has still not been fixed on aws cli |
Have same issue with aws cli and Lambda. |
same issues |
An error occurred (ValidationError) when calling the CreateStack operation: Parameters: [PrivateSubnet1CIDR, PublicSubnet2CIDR, PrivateSubnet2CIDR, PublicSubnet1CIDR] do not exist in the template |
5 years later and same issue |
Just saying. Still a problem and really annoying me. |
After adding new parameters to the template, it has to be deployed with --parameters-override for all the new parameters even if they have default value, otherwise deploy fails with:
To reproduce, deploy simple template:
add some parameter to it:
Try to deploy again, it fails with aforementioned error.
The text was updated successfully, but these errors were encountered: