DOP-C02 SDLC Automation Practice Question
A team uses AWS CodeBuild to run integration tests that require access to an Amazon RDS database. The database is in a private subnet. The CodeBuild project is configured to use a VPC. However, the builds are failing with a timeout connecting to the database. What could be the issue?
⚠ Common exam trap
Many candidates assume the issue is outbound traffic (Option B) or subnet configuration (Option A), but the real problem is the missing inbound rule on the database security group, which is a classic security group misconfiguration in VPC-connected services.
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
✓
The security group for the RDS database does not allow inbound traffic from the security group assigned to the CodeBuild project.
The RDS database is in a private subnet and its security group must explicitly allow inbound traffic from the CodeBuild project's security group. Even though CodeBuild is configured with a VPC, the default security group rules deny all inbound traffic; without an inbound rule for the database port (e.g., 3306 for MySQL) from the CodeBuild security group, the connection is blocked, causing a timeout.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The CodeBuild project's VPC configuration does not include the subnet IDs where the database resides.
Why it's wrong here
Although CodeBuild does require both the VPC ID and the subnet IDs to launch an elastic network interface in your VPC, omitting the specific subnet IDs would prevent the build from associating with the subnets that route to the database. This misconfiguration would typically cause a different failure, such as an inability to assign a network interface or a timeout due to no route to the database. However, the scenario described points to a security group rule issue, not a subnet resolution failure, so this is not the root cause.
- ✗
The security group for the CodeBuild project does not allow outbound traffic to the RDS database.
Why it's wrong here
Security groups are stateful, and by default the outbound rule for a CodeBuild project's security group is set to allow all traffic. Even if you had restricted outbound traffic, the traffic would still be blocked unless the RDS database's security group explicitly allows inbound traffic from the CodeBuild security group on the database port. Since the evidence indicates that the database is rejecting connections, the problem lies in the inbound rules of the RDS security group, not the outbound rules of the build project's group.
- ✓
The security group for the RDS database does not allow inbound traffic from the security group assigned to the CodeBuild project.
Why this is correct
This is the correct root cause because when CodeBuild runs in your VPC, it attaches the security group you specified to its ENI. For the build container to successfully connect to RDS, the database's security group must have an inbound rule that permits traffic on the database port from the source being the CodeBuild security group ID. If that rule is missing, all connection attempts will time out or be refused, regardless of other network configurations, making this the definitive security group misconfiguration to resolve.
- ✗
The CodeBuild project does not have a route to the internet via an internet gateway, so it cannot reach the RDS endpoint.
Why it's wrong here
An internet gateway is only needed for resources that require direct internet access, but RDS databases are typically placed in private subnets and are accessed internally through VPC routing. CodeBuild, when configured with VPC settings, can reach RDS using private IP addresses or the RDS endpoint as long as it is in the same VPC and proper route tables are in place. Therefore, the absence of an internet gateway is not a factor here; the communication failure is entirely due to the security group's inbound rules not authorizing the CodeBuild security group.
Visual reference
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 251-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 DOP-C02 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 DOP-C02 exam.