From 60c7d0d9b529cbc1d5a5666a2bb103b1ac6d4068 Mon Sep 17 00:00:00 2001 From: Joseph Torcasso <87090265+jatorcasso@users.noreply.github.com> Date: Mon, 9 May 2022 10:41:16 -0400 Subject: [PATCH] rds_instance - add deletion_protection param (#1105) rds_instance - add deletion_protection param Depends-On: #1116 SUMMARY Fixes #922 ISSUE TYPE Feature Pull Request COMPONENT NAME rds_instance Reviewed-by: Alina Buzachis Reviewed-by: Markus Bergholz (cherry picked from commit 77cb09740beb34940ba678495a0d60768bce2d70) --- ..._instance-add-deletion_protection-parameter.yml | 2 ++ plugins/modules/rds_instance.py | 14 ++++++++++++++ plugins/modules/rds_instance_info.py | 6 ++++++ 3 files changed, 22 insertions(+) create mode 100644 changelogs/fragments/1105-rds_instance-add-deletion_protection-parameter.yml diff --git a/changelogs/fragments/1105-rds_instance-add-deletion_protection-parameter.yml b/changelogs/fragments/1105-rds_instance-add-deletion_protection-parameter.yml new file mode 100644 index 00000000000..eca574e3929 --- /dev/null +++ b/changelogs/fragments/1105-rds_instance-add-deletion_protection-parameter.yml @@ -0,0 +1,2 @@ +minor_changes: + - rds_instance - add `deletion_protection` parameter (https://github.com/ansible-collections/community.aws/pull/1105). diff --git a/plugins/modules/rds_instance.py b/plugins/modules/rds_instance.py index 4ae96546a0c..09cb6c06979 100644 --- a/plugins/modules/rds_instance.py +++ b/plugins/modules/rds_instance.py @@ -160,6 +160,13 @@ aliases: - subnet_group type: str + deletion_protection: + description: + - A value that indicates whether the DB instance has deletion protection enabled. + The database can't be deleted when deletion protection is enabled. + By default, deletion protection is disabled. + type: bool + version_added: 3.3.0 domain: description: - The Active Directory Domain to restore the instance in. @@ -666,6 +673,12 @@ returned: always type: str sample: db-UHV3QRNWX4KB6GALCIGRML6QFA +deletion_protection: + description: C(True) if the DB instance has deletion protection enabled, C(False) if not. + returned: always + type: bool + sample: False + version_added: 3.3.0 domain_memberships: description: The Active Directory Domain membership records associated with the DB instance. returned: always @@ -1256,6 +1269,7 @@ def main(): db_security_groups=dict(type='list', elements='str'), db_snapshot_identifier=dict(), db_subnet_group_name=dict(aliases=['subnet_group']), + deletion_protection=dict(type='bool'), domain=dict(), domain_iam_role_name=dict(), enable_cloudwatch_logs_exports=dict(type='list', aliases=['cloudwatch_log_exports'], elements='str'), diff --git a/plugins/modules/rds_instance_info.py b/plugins/modules/rds_instance_info.py index 22a10a081ed..6e41ea62940 100644 --- a/plugins/modules/rds_instance_info.py +++ b/plugins/modules/rds_instance_info.py @@ -188,6 +188,12 @@ returned: always type: str sample: db-AAAAAAAAAAAAAAAAAAAAAAAAAA + deletion_protection: + description: C(True) if the DB instance has deletion protection enabled, C(False) if not. + returned: always + type: bool + sample: False + version_added: 3.3.0 domain_memberships: description: List of domain memberships returned: always