nerdexam
Amazon

SCS-C02 · Question #51

A security engineer is working with a company to design an ecommerce application. The application will run on Amazon EC2 instances that run in an Auto Scaling group behind an Application Load…

The correct answer is A. Deploy a NAT gateway in each private subnet for every Availability Zone that is in use. C. Place the DB instance in a private subnet. E. Configure the Auto Scaling group to place the EC2 instances in a private subnet. EC2 instances in private subnets behind a NAT gateway provide stable outbound IPs for the payment provider's allowlist, while keeping the database and compute tiers private and secure.

Submitted by femi9· Mar 6, 2026Infrastructure Security

Question

A security engineer is working with a company to design an ecommerce application. The application will run on Amazon EC2 instances that run in an Auto Scaling group behind an Application Load Balancer (ALB). The application will use an Amazon RDS DB instance for its database. The only required connectivity from the internet is for HTTP and HTTPS traffic to the application. The application must communicate with an external payment provider that allows traffic only from a preconfigured allow list of IP addresses. The company must ensure that communications with the external payment provider are not interrupted as the environment scales. Which combination of actions should the security engineer recommend to meet these requirements? (Choose three.)

Options

  • ADeploy a NAT gateway in each private subnet for every Availability Zone that is in use.
  • BPlace the DB instance in a public subnet.
  • CPlace the DB instance in a private subnet.
  • DConfigure the Auto Scaling group to place the EC2 instances in a public subnet.
  • EConfigure the Auto Scaling group to place the EC2 instances in a private subnet.
  • FDeploy the ALB in a private subnet.

How the community answered

(56 responses)
  • A
    75% (42)
  • B
    4% (2)
  • D
    7% (4)
  • F
    14% (8)

Why each option

EC2 instances in private subnets behind a NAT gateway provide stable outbound IPs for the payment provider's allowlist, while keeping the database and compute tiers private and secure.

ADeploy a NAT gateway in each private subnet for every Availability Zone that is in use.Correct

A NAT gateway has a static Elastic IP address. Placing NAT gateways in each private subnet's Availability Zone ensures that all outbound traffic from the EC2 instances exits through a known, fixed IP that can be added to the external payment provider's allowlist, even as Auto Scaling adds or removes instances.

BPlace the DB instance in a public subnet.

Placing the RDS DB instance in a public subnet exposes the database directly to the internet, creating an unnecessary and significant security vulnerability that violates AWS security best practices.

CPlace the DB instance in a private subnet.Correct

The RDS DB instance must be in a private subnet to prevent direct internet access, following the defense-in-depth security principle. Only the application tier should communicate with the database over private network paths.

DConfigure the Auto Scaling group to place the EC2 instances in a public subnet.

Placing EC2 instances in public subnets gives each instance a public IP, but Auto Scaling can assign different IPs as instances are replaced, making it impossible to maintain a stable allowlist with the external payment provider.

EConfigure the Auto Scaling group to place the EC2 instances in a private subnet.Correct

EC2 instances running the application logic should reside in private subnets. The ALB in public subnets handles inbound internet traffic and forwards requests to the private instances, while the NAT gateway handles outbound traffic without exposing instance IPs publicly.

FDeploy the ALB in a private subnet.

An Application Load Balancer must be deployed in public subnets to receive incoming traffic from the internet. Placing the ALB in a private subnet would make the application inaccessible from the internet.

Concept tested: NAT gateway for stable outbound IPs and VPC subnet architecture

Source: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html

Topics

#NAT gateway#VPC subnet design#ALB#private subnet architecture

Community Discussion

No community discussion yet for this question.

Full SCS-C02 Practice