Question 1,034 of 1,663
RDS MySQL IAM Database Authentication — Troubleshooting Name Mismatch
A company uses Amazon RDS for MySQL with encryption at rest enabled. The security team mandates that all access to the database must be authenticated using IAM database authentication. The database administrator has created a user 'app_user' and granted appropriate privileges. However, when the application tries to connect using an IAM authentication token, it receives an 'Access denied' error. Which action should be taken to resolve this issue?
Quick Answer
The answer is to ensure the IAM role used by the application has a name that matches the database user 'app_user' and has the necessary policy attached. This is correct because RDS MySQL IAM database authentication requires an exact name match between the database user and the IAM principal (user or role) that generates the authentication token; the token is cryptographically bound to that principal’s name, so any mismatch causes an 'Access denied' error. On the AWS Certified Database Specialty DBS-C01 exam, this concept tests your understanding of how IAM database authentication enforces identity binding at the database level, often appearing as a trap where candidates overlook the name-matching requirement or confuse it with standard IAM policy evaluation. A common memory tip is to think of the IAM principal and the database user as a key and lock that must share the same label—if the names don’t align, the token simply won’t turn.
⚠ Common exam trap
Many exam-takers confuse IAM database authentication with network-level security (security groups) or TLS certificate management, when the core requirement is the exact name match between the database user and the IAM principal (role or user) used to generate the token.
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
✓
Ensure the IAM role used by the application has a name that matches the database user 'app_user' and has the necessary policy attached.
IAM database authentication for RDS MySQL requires that the database user name matches the IAM role or user name used to generate the authentication token. The IAM role must have a policy that allows the `rds-db:connect` action with a resource ARN specifying the database user. Without this exact match, the authentication token is rejected, resulting in an 'Access denied' error.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a password for 'app_user' and use that password in the connection string.
Why it's wrong here
IAM database authentication does not require a password; the authentication token replaces the password.
- ✗
Modify the security group to allow inbound traffic on port 3306 from the application's IP address.
Why it's wrong here
Network connectivity is likely fine; the error is an authentication failure, not a connection timeout.
- ✓
Ensure the IAM role used by the application has a name that matches the database user 'app_user' and has the necessary policy attached.
Why this is correct
IAM database authentication requires the database user name to match the IAM user or role name (or a mapped DB user) that has been granted the rds_iam role.
- ✗
Download the latest Amazon RDS CA certificate and add it to the application trust store.
Why it's wrong here
Certificate validation is for SSL connections, but the error is specifically about access denied, not SSL handshake failure.
Visual reference
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on DBS-C01
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company is using Amazon RDS for MySQL with encryption at rest enabled. The security team requires that all access to the database be authenticated using IAM database authentication. Which combination of steps must the company take to meet this requirement?
medium- A.Create an IAM role with a policy that allows rds:Connect and attach it to the RDS instance.
- B.Create a database user with a password and attach an IAM role that allows rds-db:connect to the database user.
- C.Enable SSL on the RDS instance and create an IAM policy that allows rds:Connect.
- ✓ D.Create an IAM policy that allows the rds-db:connect action and map the IAM role to a database user created with the AWSAuthenticationPlugin.
Why D: IAM database authentication for Amazon RDS MySQL requires creating an IAM policy that allows the rds-db:connect action, then mapping that IAM role/entity to a database user created with the AWSAuthenticationPlugin. This enables authentication via IAM credentials instead of a password. Option A is incorrect because rds:Connect is not a valid action; the correct action is rds-db:connect, and the IAM role is not attached to the RDS instance but mapped to a database user. Option B is incorrect because IAM database authentication does not use passwords; the database user must be created with AWSAuthenticationPlugin, not with a password. Option C is incorrect because SSL is not required for IAM database authentication, though it is recommended for encryption in transit; also, the correct action is rds-db:connect, not rds:Connect.
Variation 2. A financial services company uses Amazon RDS for MySQL to store sensitive customer data. The compliance team requires that all database administrators (DBAs) must authenticate using IAM database authentication, and no static database passwords should be used. A junior DBA has been granted the rds_iam role in the database. However, the junior DBA is unable to connect using the AWS CLI command: aws rds generate-db-auth-token --hostname mydb.xyz.us-east-1.rds.amazonaws.com --port 3306 --username jdba. The error message says 'Access denied'. What is the most likely cause?
hard- A.The RDS instance does not have a resource-based policy that grants the junior DBA access.
- B.The junior DBA is not using an SSL connection to the database.
- C.The security group does not allow inbound traffic on port 3306 from the junior DBA's IP address.
- ✓ D.The RDS instance does not have IAM database authentication enabled.
Why D: For IAM database authentication to work, the RDS instance must have the 'IAM DB authentication' setting enabled. If it is not enabled, the authentication token generated by `generate-db-auth-token` will be rejected with an 'Access denied' error. Option A is incorrect because RDS does not use resource-based policies; IAM policies are attached to users/roles. Option B is incorrect because SSL is required for IAM auth, but a missing SSL connection would result in a different error (e.g., 'SSL required'). Option C is incorrect because network issues would typically cause a timeout or connection refused, not an authentication error.
Last reviewed: Jun 11, 2026
This DBS-C01 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 DBS-C01 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.