Repository: ansible-collections/community.aws

Issue:
rds_instance: modify delete protection
### Summary

I am trying to modify an RDS instance that has delete protection on it, preventing deletion. I would like the ability to modify this via ansible directly

```
for rds in $(aws rds describe-db-instances | jq -r '.DBInstances.[].DBInstanceIdentifier'); do
  aws rds modify-db-instance --no-deletion-protection --db-instance-identifier "${rds}"
done
```

### Issue Type

Feature Idea

### Component Name

rds_instance

### Additional Information

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
- name: Get all RDS instances
  community.aws.rds_instance_info:
    region: "{{ region }}"
    aws_access_key: "{{ aws_access_key_id }}"
    aws_secret_key: "{{ aws_secret_access_key }}"
  register: __rds_instances

- name: Remove delete protection from any DB instances
  community.aws.rds_instance:
    id: "{{ item.db_instance_identifier }}"
    deletion_protection: false
  loop: __rds_instances.instances

- name: Remove any DB instance without a final snapshot
  community.aws.rds_instance:
    id: "{{ item.db_instance_identifier }}"
    state: absent
    skip_final_snapshot: true
  loop: __rds_instances.instances

```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Hi @jbpratt! Thanks for requesting this. I went ahead and opened a PR for this since I was already working on this module. In the future, feel free to open a PR yourself and ask any questions that you may have.
cc @jillr @markuman @rrey @s-hertel @tremble
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/plugins/modules/rds_instance.py b/plugins/modules/rds_instance.py
--- 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
--- 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


Test patch: