Description
publiclyAccessible: true gives an RDS instance public addressing. A client still needs working DNS, a route to the endpoint, and a security group that permits its connection.
Potential impact
A later network-rule change can expose a public address to unintended clients. If they also have credentials or excessive privileges, they may read or change data.
Remediation
- For an internal database, establish a private path through the VPC or VPN and set
publiclyAccessible: false. Check subnet-group routes and security groups, and review changes withpulumi preview. Test application and admin connections afterward. - If public access is needed, allow only approved sources and DB ports. Require authentication, least-privilege DB permissions, encryption in transit and secure password management.
Examples
Provide the subnet group, security groups and supported engine, instance class and storage. manageMasterUserPassword uses RDS-managed credentials in Secrets Manager. skipFinalSnapshot: true omits the final snapshot on deletion. Choose that setting according to your recovery policy.
Before
name: aws-rds
runtime: yaml
description: An RDS Instance
resources:
default:
type: aws:rds:Instance
properties:
allocatedStorage: 20
dbName: mydb
engine: mysql
instanceClass: db.t3.micro
manageMasterUserPassword: true
skipFinalSnapshot: true
username: foo
publiclyAccessible: true
After
name: aws-rds
runtime: yaml
description: An RDS Instance
resources:
default:
type: aws:rds:Instance
properties:
allocatedStorage: 20
dbName: mydb
engine: mysql
instanceClass: db.t3.micro
manageMasterUserPassword: true
skipFinalSnapshot: true
username: foo
publiclyAccessible: false
Explanation: Disabling public access removes public addressing. Verify private connectivity, authentication, password management, and backups as well.