-
Notifications
You must be signed in to change notification settings - Fork 166
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
Raw templates do not use existing parameters #593
Comments
@aarongorka can you provide a cloudformation template that reproduces the issue? I have a feeling the source the problem is related to NoEcho and this line: That should probably be using |
template.yml: AWSTemplateFormatVersion: "2010-09-09"
Parameters:
MyNormalParam:
Type: String
MyPrivateParam:
Type: String
NoEcho: true
Resources:
Bucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: !Sub "${AWS::AccountId}-${MyNormalParam}-${MyPrivateParam}"
stacker.yml: namespace: ""
namespace_delimiter: ""
stacks:
- name: param-test-stack
template_path: ./template.yml
variables:
MyNormalParam: stacker
MyPrivateParam: test-bucket You can test by deploying as-is, then try to update after commenting out one or more of the variables. The error occurs with both normal parameters and NoEcho parameters. Is stacker/stacker/actions/build.py the right place to contain this logic if both build and diff require it? The exception is currently being raised in |
Before this we actually provided the value from the existing parameter, but that's not really what cloudformation wants, and it can lead to issues when using raw templates. Fixes #593
Hey @aarongorka - this should be fixed in #615. Take a look and let me know if you run into any other issues! |
* Add helper Makefile for more easier integration tests * no need for cd, -C is better * Use UsePreviousValue on existing parameters Before this we actually provided the value from the existing parameter, but that's not really what cloudformation wants, and it can lead to issues when using raw templates. Fixes #593 * Don't catch missing variables in the raw blueprint We check for this later in `stacker/action/build.py` with `_handle_missing_parameters`. This allows raw stacks to use the `UsePreviousValue` option for parameters if a previous stack exists, and it has the parameter, otherwise it blows up. * Don't manually grab default, let cloudformation handle that * Fixes the order of operations for missing params New order of operations: - If a parameter is passed in via the config, use that. - If there is an existing stack and it has the Parameter already, UsePreviousValue - If there is a Default on the Parameter, use that value. * Make it possible to run a single test case * Add specific test examples * No longer have _all_ method * Functional test for this fix * Comment in yaml template on what it is used for * Fix functional tests for new functional test method
* Add helper Makefile for more easier integration tests * no need for cd, -C is better * Use UsePreviousValue on existing parameters Before this we actually provided the value from the existing parameter, but that's not really what cloudformation wants, and it can lead to issues when using raw templates. Fixes cloudtools#593 * Don't catch missing variables in the raw blueprint We check for this later in `stacker/action/build.py` with `_handle_missing_parameters`. This allows raw stacks to use the `UsePreviousValue` option for parameters if a previous stack exists, and it has the parameter, otherwise it blows up. * Don't manually grab default, let cloudformation handle that * Fixes the order of operations for missing params New order of operations: - If a parameter is passed in via the config, use that. - If there is an existing stack and it has the Parameter already, UsePreviousValue - If there is a Default on the Parameter, use that value. * Make it possible to run a single test case * Add specific test examples * No longer have _all_ method * Functional test for this fix * Comment in yaml template on what it is used for * Fix functional tests for new functional test method
When diffing/building with a raw template, existing parameters/variables do not get used.
In this case the
my-app
stack is already deployed with the parameterMyParameter
asNoEcho
. Ideally, It would be nice if Stacker could understand that the parameter is already set and can be reused with theUsePreviousValue
setting when building (http://boto3.readthedocs.io/en/latest/reference/services/cloudformation.html#CloudFormation.Client.create_stack). When running a diff, it can assume that nothing has changed.Stacker version: 1.3.0
Steps to reproduce: manually deploy a CloudFormation template with 1 parameter (ideally
NoEcho
as there seems to be some logic in_handle_missing_parameters
that pulls the existing values down). Then, run a diff/build with the variable omitted.The text was updated successfully, but these errors were encountered: