Skip to content

Commit

Permalink
add support for DisableRollback to upadte stack
Browse files Browse the repository at this point in the history
  • Loading branch information
mandar242 committed Aug 1, 2023
1 parent 31c7506 commit 5875d15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- cloudformation - Add support for `disable_rollback` to update stack operation. (https://github.com/ansible-collections/amazon.aws/issues/1681).
4 changes: 3 additions & 1 deletion plugins/modules/cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def create_stack(module, stack_params, cfn, events_limit):
msg="Either 'template', 'template_body' or 'template_url' is required when the stack does not exist."
)

# 'DisableRollback', 'TimeoutInMinutes', 'EnableTerminationProtection' and
# 'TimeoutInMinutes', 'EnableTerminationProtection' and
# 'OnFailure' only apply on creation, not update.
if module.params.get("on_create_failure") is not None:
stack_params["OnFailure"] = module.params["on_create_failure"]
Expand Down Expand Up @@ -483,6 +483,8 @@ def update_stack(module, stack_params, cfn, events_limit):
if module.params["stack_policy_on_update_body"] is not None:
stack_params["StackPolicyDuringUpdateBody"] = module.params["stack_policy_on_update_body"]

stack_params["DisableRollback"] = module.params["disable_rollback"]

# if the state is present and the stack already exists, we try to update it.
# AWS will tell us if the stack template and parameters are the same and
# don't need to be updated.
Expand Down

0 comments on commit 5875d15

Please sign in to comment.