AWS Certified Developer – Associate — Question 32

An application running on Amazon EC2 opens connections to an Amazon RDS SQL Server database. The developer does not want to store the user name and password for the database in the code. The developer would also like to automatically rotate the credentials.
What is the MOST secure way to store and access the database credentials?

Answer options

Correct answer: B

Explanation

The most secure option is to use AWS Secrets Manager (option B), as it allows for safe storage, retrieval, and automatic rotation of credentials. Option A is incorrect because IAM roles do not store credentials; they provide access permissions. Option C is less secure due to the risk of exposing the S3 bucket. Option D is insecure, as hardcoding credentials in the source code is a bad practice, regardless of repository privacy.