SCS-C02 Infrastructure Security Practice Question
A company deploys an AWS Lambda function inside a VPC to read from an Amazon RDS for PostgreSQL database in a private subnet. The function also needs to write logs to CloudWatch Logs and store objects in Amazon S3. The security team wants to eliminate the need for a NAT gateway while still allowing the function to reach both AWS services. Which combination of actions should the engineer take?
⚠ Common exam trap
The trap here is assuming that a gateway endpoint can be created for any AWS service, when gateway endpoints exist only for Amazon S3 and DynamoDB.
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
✓
Create gateway endpoints for Amazon S3 and interface endpoints for CloudWatch Logs, associate them with the function's subnets, and attach a security group to the interface endpoints that allows HTTPS from the function's security group.
Gateway endpoints serve Amazon S3 without hourly charges, while interface endpoints powered by AWS PrivateLink serve CloudWatch Logs. Because interface endpoints are elastic network interfaces, the endpoint's security group must allow inbound HTTPS from the Lambda function's security group, and private DNS resolution lets the SDK reach the service names transparently.
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 gateway endpoint for Amazon S3 and a gateway endpoint for CloudWatch Logs, then associate both with the function's route tables.
Why it's wrong here
Gateway endpoints are supported only for Amazon S3 and DynamoDB, not CloudWatch Logs, so the second endpoint cannot be created. The logging path would still require either a NAT gateway or an interface endpoint, meaning the proposed design does not satisfy the requirement.
- ✗
Create interface endpoints for both Amazon S3 and CloudWatch Logs, and enable private DNS so the function resolves the service names to the endpoint addresses.
Why it's wrong here
Although interface endpoints for S3 are possible, using a gateway endpoint for S3 is more cost-effective and equally private. More importantly, this option omits the endpoint security group rule that permits HTTPS from the function, so the log writes would be blocked at the endpoint's network interface.
- ✓
Create gateway endpoints for Amazon S3 and interface endpoints for CloudWatch Logs, associate them with the function's subnets, and attach a security group to the interface endpoints that allows HTTPS from the function's security group.
Why this is correct
Gateway endpoints for S3 and interface endpoints for CloudWatch Logs keep that traffic on the AWS network, so no NAT gateway is needed. Interface endpoints use elastic network interfaces with security groups, so permitting HTTPS from the Lambda function's security group is required for the logs path to succeed.
- ✗
Attach an internet gateway to the VPC and update the function's route table to direct 0.0.0.0/0 to the internet gateway, then rely on the function's security group to restrict egress.
Why it's wrong here
An internet gateway provides public connectivity but does not give private subnets outbound access without public IP addresses and additional routing, and it reintroduces the internet exposure the team wants to avoid. The requirement is to reach AWS services privately without a NAT gateway, which this design does not achieve.
Visual reference
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
One of 1,205 original SCS-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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
This SCS-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 SCS-C02 exam.