-
Notifications
You must be signed in to change notification settings - Fork 167
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
Let raw templates use previous Parameter values #615
Conversation
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
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.
BTW, if anyone has a better idea than using a class to represent when we should |
@troyready would love your eyes on this as well, as it changes the way the raw blueprints work. |
I really, really like the simplicity of it. |
This has a small potential bug in it, though it's more a question of what people would expect the behavior to be. As it's written now, if a stack has a I think the right order of resolution for Parameters should be:
The way it is currently is:
Which sounds right to everyone? @troyready @ejholmes @aarongorka ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good, but can we add a functional test that would break before this change?
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.
Ok, I have a test suite now that fails in master, but is fixed here. in master:
in this branch:
This makes this PR rely on #597 since I got sick of having to run all the tests :) You can ignore all the functional tests except for 28 (https://github.com/cloudtools/stacker/pull/615/files#diff-2a1538382726a9ab337f7c118a526539) - once #597 is merged, this should clean up. |
* 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
This changes a couple of things:
UsePreviousValue
argument for parameters that exist in an existing stack, rather than getting the value there and providing it ourselves. This is more "cloudformation-y".stacker.actions.build._handle_missing_parameters
already handles this for us.Fixes #593