SAA-C03 Design Secure Architectures Practice Question
A healthcare document service uses Amazon RDS for PostgreSQL. Application credentials must not be stored on the EC2 instances, and authentication should use short-lived credentials. What should the architect recommend?
⚠ Common exam trap
It's easy for candidates to think security groups alone solve credential management, but they only control network access, not authentication or credential lifecycle, so they fail to address the short-lived credential requirement.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
IAM database authentication for RDS with an EC2 instance role
IAM database authentication for RDS with an EC2 instance role is correct because it allows the EC2 instance to assume an IAM role and obtain a short-lived authentication token (valid for 15 minutes) to connect to the PostgreSQL database, eliminating the need to store any credentials on the instance. This approach meets both requirements: no credentials stored on EC2 and the use of short-lived credentials. The token is generated using the AWS CLI or SDK with the IAM role's temporary security credentials, and the RDS instance must be configured to accept IAM authentication.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Embed the database password in the AMI
Why it's wrong here
Embedding the database password in the AMI means a static credential is reproduced on every instance launched from that image. This makes password rotation require rebuilding and re-deploying the entire AMI, and anyone with access to the AMI snapshot or its layers can extract the secret. It also provides no per-resource identity or temporary credential mechanism, so an application compromise exposes the same permanent database password.
- ✗
Store the database password in user data
Why it's wrong here
Passing the database password through EC2 user data is insecure because user data is retrievable at runtime from the instance metadata service (http://169.254.169.254/latest/user-data) and can be viewed by any user or process with instance-level access. The password is also accessible to anyone who can call DescribeInstanceAttribute on the instance in the AWS console or API. Unlike IAM authentication, this gives no short-lived, scoped credential and still requires manual password management.
- ✗
Use a security group rule that allows only application instances
Why it's wrong here
A security group rule that admits only application instances restricts the network source that can reach the PostgreSQL listener, but it does not authenticate the caller once that source is allowed. If the application instance is compromised, an attacker on it can connect just as easily as legitimate code, because the database still requires a static password (or another mechanism) at the client layer. Security groups therefore control traffic, not DB user identity or permission.
- ✓
IAM database authentication for RDS with an EC2 instance role
Why this is correct
IAM database authentication lets the EC2 instance assume a role with an rds-db:connect permission; the application then generates a temporary authentication token with aws rds generate-db-auth-token and supplies it as the PostgreSQL password. This token, signed with SigV4, expires in 15 minutes, so no long-lived password is stored in code, configuration, or the AMI. The instance role also gives you a clean, auditable identity that can be scoped precisely to that DB user. Note that the database user must still be created (with the name matching the IAM principal) for the role to work.
Go deeper
Related to this question
About these practice questions
This SAA-C03 question is part of Courseiva's 935-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SAA-C03 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAA-C03 exam.