sceptre
sceptre copied to clipboard
Add ability to create a new stack with change sets
I would like to be able to use change sets on new stacks as well as existing stacks.
AWS/boto supports creating a new stack with change sets using the ChangeSetType
keyword see here for details. To the untrained eye, it appears that updating the cli create
and update
to pass an argument of change_set_type
to the create_change_set
function, and updating that function to accept the new argument may get me the functionality I'm after. I'm up for a PR if this makes sense to implement.
Outputs may be a bit tricky to deal with, but I haven't gotten that far down the path yet.
It looks like there was an attempt to address this with #198 , but that appears to have been closed, and inactive for awhile (thus the new issue).
That's a good catch. I just started using change-sets myself and haven't realized that my workflow will break anytime I add a new environment to my configs in CI/CD.
Here's the error:
$ sceptre create -y dummy test
/Users/msverdlik/.virtualenvs/sceptre/lib/python3.7/site-packages/yaml/constructor.py:126:
An error occurred (ValidationError) when calling the CreateChangeSet operation: Stack [test-dummy] does not exist
Yep I think we should support this. Also partly related to #520
I have implemented a change locally to get basic change sets working when creating a new stack. I would like to inquire if you would accept a limited scope pull request for this... if so I think it would be good to clarify the exact scope of the changes before submitting a pull request.
plan/actions.py(create_change_set)
- Add 2nd argument
change_set_type
to def - Add parameter
change_set_type
tocreate_change_set_kwargs
asChangeSetName
cli/create.py(create_command)
- Add argument
change_set_type=CREATE
toplan.create_change_set
call
cli/update.py(update_command)
- Add argument
change_set_type=UPDATE
toplan.create_change_set
call
Corresponding Tests & Documentation to be added as appropriate
@ngfgrant any thoughts on @sacvalleytech's comment?
Is there any chance of moving this along? At the moment we can't create changesets for new stacks, which breaks any ability to use changesets for a group when new stacks are involved, which means we can't preview our changes, which is dangerous for production deploys.
This could be added at least for treating cases were there are no dependent stacks. Would solve my use case at least as I don't use sceptre for beyond single stacks creation/updates. A CLI option could be used to alter the default behavior.