For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/ansible-aws-rds-db-instance-publicly-accessible.md.
A documentation index is available at /llms.txt.
RDS instances must not be configured as publicly accessible. Exposing a database to the public internet increases the risk of unauthorized access and enables brute-force or credential-stuffing attacks.
In Ansible RDS tasks using the amazon.aws.rds_instance or rds_instance modules, ensure the publicly_accessible property is set to false. Tasks with publicly_accessible: true are flagged. If the property is omitted, the modules default to false, but explicitly setting it to false and placing instances in private subnets with restrictive security groups provides defense-in-depth.