SAP-C02 Continuous Improvement for Existing Solutions Practice Question
A company runs a containerized application on Amazon ECS with Fargate. The application needs to access an Amazon RDS database that is in a private subnet. The ECS tasks are launched in a public subnet. How should they configure network access?
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
✓
Launch the ECS tasks in the same private subnet as the RDS instance.
ECS tasks should be launched in the same private subnet as the RDS instance to allow direct network communication via VPC routing, without needing internet gateways or NAT. Option B is incorrect because placing ECS tasks in a public subnet with a NAT gateway would require traffic to go through the NAT, but NAT gateways are for outbound internet access, not for inbound traffic to private resources; also, public subnets have direct internet access which is unnecessary and could introduce security risks. Option C is incorrect because a VPN connection is typically used for on-premises to VPC connectivity, not for internal VPC communication; VPC routing and security groups are sufficient. Option D is incorrect because an Application Load Balancer is used for load balancing HTTP/HTTPS traffic to application targets, not for routing internal database traffic; it would add unnecessary complexity and latency.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Launch the ECS tasks in the same private subnet as the RDS instance.
Why this is correct
Tasks in the same subnet can communicate via security groups.
- ✗
Place the ECS tasks in a public subnet and use a NAT gateway to route traffic to the database.
Why it's wrong here
NAT gateway is for outbound internet, not inbound to private subnet.
- ✗
Set up a VPN connection between the ECS tasks and the database.
Why it's wrong here
VPN is unnecessary; same VPC connectivity is sufficient.
- ✗
Use an Application Load Balancer to route traffic to the database.
Why it's wrong here
ALB is for HTTP/HTTPS traffic, not database connections.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every SAP-C02 question from scratch — 1,660 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on SAP-C02
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 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?
easy- A.Use a NAT gateway to route traffic from ECS tasks to RDS.
- B.Attach an internet gateway to the VPC and route through it.
- C.Enable public accessibility on the RDS instance and restrict access to the ECS task public IP.
- ✓ D.Place the ECS tasks and RDS instance in the same VPC, and configure security groups to allow traffic on the database port.
Why D: 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.
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.