Trace a request through a private application
Design network boundaries, authentication and managed protection for a public application with a private data tier.
Task 1.2 · Trace a request through a private application
Follow the packet both ways
For a public web application, place an internet-facing Application Load Balancer (ALB) in subnets in at least two Availability Zones with a route to an internet gateway. Put application targets and the database in private subnets. Allow the application port from the ALB security group, then the database port from the application security group. Security groups track connections. Subnet network ACLs are ordered, stateless allow/deny rules and need return traffic rules. A route, an allowed port and an authorized application identity solve three separate problems.
Give private subnets a deliberate exit
A NAT gateway in a public subnet can carry outbound IPv4 internet traffic from private instances. For S3 or DynamoDB use a gateway VPC endpoint and associated routes when appropriate. Interface endpoints use private addresses and security groups for supported services. Restrict endpoint and resource policies. For a data center, Site-to-Site VPN provides encrypted tunnels over IP. Direct Connect supplies private connectivity. If transport encryption is required, design TLS, a VPN overlay or supported link encryption explicitly.
Match each control to a signal
Use ACM certificates for the HTTPS listener, Cognito for customer identities, and Secrets Manager for database credentials and rotation. AWS WAF filters application-layer requests, including managed rules and rate-based controls. Shield addresses DDoS protection. GuardDuty produces threat findings, Macie discovers sensitive data in S3, Inspector identifies workload vulnerabilities and Security Hub aggregates findings. Gate origin access so the intended front door is actually on the request path.
Keep a maintenance path and test protective rules
For a supported private server, Systems Manager Session Manager can provide operator access through its agent, instance role and outbound service connectivity. Authorize the operator separately and record sessions as required. For the public application, combine parameterized database queries with appropriate managed WAF rules for SQL injection. Try new WAF rules in count mode and examine legitimate checkout traffic before enforcing. Shield and GuardDuty serve different roles in protecting and observing the workload.
A health check fails after a subnet change
The ALB can reach port 8080 on existing healthy targets. Targets in a new private subnet time out. Both groups use identical rules and the application listens on 8080. The new subnet ACL allows inbound 8080 and denies other traffic in both directions.
What evidence would distinguish a faulty application from a return-path problem?
Compare your design with the worked answer
Inspect target health reasons and VPC Flow Logs for the new subnet. Check outbound ACL permission for the ephemeral destination ports used by the ALB connections. Add narrowly scoped return rules and retry the health check. Stateful security groups alone cannot override a subnet ACL denial.
For an application returning HTTP 401 promptly, the network round trip already succeeded. Check the health-check path, expected response and application authentication instead.
Apply the video example
The VPC walkthrough places network ACLs at subnet boundaries. On paper, write one row for the outbound response with its actual destination port. Reusing the inbound service port in this row is a common reason that a permitted request appears to hang.
freeCodeCamp at 12:22:46 · VPC network ACLs
AWS exam guide for this domain · Return to the objective map
Trace a request through a private application quiz
Answer 5 questions. Check each answer for an explanation.