From 9608331b0b34bc67b42c057cdd277f220a50b9db Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Wed, 11 Aug 2021 12:25:22 +0200 Subject: [PATCH] aws_secret - fix deletion idempotency when not using instant deletion --- aws_secret.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws_secret.py b/aws_secret.py index 86c6d6e3521..dfe1013194d 100644 --- a/aws_secret.py +++ b/aws_secret.py @@ -367,6 +367,8 @@ def main(): elif current_secret.get("DeletedDate") and recovery_window == 0: result = camel_dict_to_snake_dict(secrets_mgr.delete_secret(secret.name, recovery_window=recovery_window)) changed = True + else: + result = "secret already scheduled for deletion" else: result = "secret does not exist" if state == 'present': @@ -393,6 +395,7 @@ def main(): changed = True result = camel_dict_to_snake_dict(secrets_mgr.get_secret(secret.name)) result.pop("response_metadata") + module.exit_json(changed=changed, secret=result)