Skip to content

Commit

Permalink
bugfix when updating stack's termination_protection
Browse files Browse the repository at this point in the history
  • Loading branch information
mandar242 committed Dec 11, 2024
1 parent b9a5127 commit 5ae92e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/modules/cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,14 +779,17 @@ def main():
if state == "present":
if not stack_info:
result = create_stack(module, stack_params, cfn, module.params.get("events_limit"))
elif module.params.get("create_changeset"):
result = create_changeset(module, stack_params, cfn, module.params.get("events_limit"))
else:
changeset_updated = False
if module.params.get("create_changeset"):
result = create_changeset(module, stack_params, cfn, module.params.get("events_limit"))
changeset_updated = True
if module.params.get("termination_protection") is not None:
update_termination_protection(
module, cfn, stack_params["StackName"], bool(module.params.get("termination_protection"))
)
result = update_stack(module, stack_params, cfn, module.params.get("events_limit"))
if not changeset_updated:
result = update_stack(module, stack_params, cfn, module.params.get("events_limit"))

# format the stack output

Expand Down

0 comments on commit 5ae92e6

Please sign in to comment.