SAP-C02 Continuous Improvement for Existing Solutions Practice Question
A company has deployed a web application on Amazon ECS with Fargate. The application needs to access an Amazon RDS database. The security team mandates that the database must not be publicly accessible. What is the best way to securely connect the ECS tasks to the RDS database?
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
✓
Place the ECS tasks and RDS instance in the same VPC, and configure security groups to allow traffic on the database port.
Placing ECS tasks and RDS in the same VPC allows private communication via security groups. This ensures the database is not publicly accessible. Option A is incorrect because a NAT gateway is for outbound internet access, not for inbound traffic to RDS. Option B is incorrect because an internet gateway would expose the RDS instance to the internet. Option C is incorrect because enabling public accessibility would violate the security mandate even with IP restrictions.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a NAT gateway to route traffic from ECS tasks to RDS.
Why it's wrong here
NAT gateway is for outbound internet, not private VPC communication.
- ✗
Attach an internet gateway to the VPC and route through it.
Why it's wrong here
Internet gateway is for internet traffic, not needed for private communication.
- ✗
Enable public accessibility on the RDS instance and restrict access to the ECS task public IP.
Why it's wrong here
Public accessibility violates the security requirement.
- ✓
Place the ECS tasks and RDS instance in the same VPC, and configure security groups to allow traffic on the database port.
Why this is correct
This ensures traffic stays within the VPC.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 1,660 original SAP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SAP-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 SAP-C02 exam.