A large enterprise deploys a web application on EC2 instances behind an ALB with Auto Scaling across AZs. The application uses Amazon RDS for Oracle and DynamoDB, and there are dev, test, and prod environments. What is the most secure and flexible method to obtain credentials during deployment?
Choose an answer
Tap an option to check your answer.
Correct answer: Launch EC2 instances with an instance role to obtain AWS permissions, and retrieve database credentials from AWS Secrets Manager..
Why this is the answer
The most secure and flexible method is to launch EC2 instances with an instance profile (which grants an instance role) to obtain AWS permissions. This eliminates the need to embed or manage AWS access keys on the instances, adhering to the principle of least privilege and reducing the risk of credential compromise. For database credentials, AWS Secrets Manager is the best choice because it is designed for secure storage, retrieval, and automatic rotation of secrets, including database credentials. Storing an access key in a SecureString parameter (first option) is less secure than using an instance role, as the key still exists and could be exposed. Storing an access key in plaintext (third option) is highly insecure and should never be done. Storing database passwords in an encrypted configuration file (fourth option) is less flexible and secure than Secrets Manager, as it requires manual management of encryption keys and rotation, and the secrets are bundled with the application, increasing exposure risk.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed