Preventing Dropped TGW Traffic with Network ACLs and Lambda
Short answer
A Configure the existing Lambda function to add the destination IP addresses of the dropped traffic to each SNS notification. Configure the new Lambda function to create an outbound rule by using the destination IP addresses in the network ACL.
Question
Key Takeaways
The core test is understanding NACL rule direction: outbound rules filter traffic leaving a subnet and use destination IPs, while inbound rules use source IPs.
This ANS-C01 question explores how to automatically block traffic dropped by a transit gateway by applying network ACL rules. The community consensus favors adding destination IP addresses to SNS notifications and creating outbound NACL rules to prevent traffic from leaving the VPC.
Common mistake: Choosing option C (27% of votes), which incorrectly suggests using source IP addresses in an outbound NACL rule. Outbound NACL rules cannot filter by source IP; they target destination IPs.
Expert Analysis
Why the Answer Is Correct
Option A is correct because the traffic identified in the flow logs is being dropped by the transit gateway, meaning it is outbound traffic from the VPC. To block it from leaving, you must create an outbound network ACL rule on the transit gateway attachment subnets. Outbound rules are evaluated based on the destination IP address. By adding the destination IP addresses of the dropped traffic to the SNS notification, the new Lambda function can create an outbound deny rule that matches those destinations, effectively preventing the traffic from leaving the VPC.
The comments supporting A correctly point out that “destination IP addresses identify where the problematic traffic is trying to go” and that “outbound rules prevent traffic from leaving the VPC.” This aligns with AWS network ACL semantics: an outbound rule uses the destination field, not the source field.
Why the Other Options Are Wrong
Option B is wrong because it uses source IP addresses and an inbound rule. Inbound rules apply to traffic entering a subnet, not leaving it, and they filter by source IP. This would not stop outbound traffic. Option C is the most tempting but fundamentally incorrect: outbound NACL rules do not have a “source” field; they only use destination addresses. Creating an outbound rule with source IP addresses is impossible in the AWS console or API. Option D is wrong because inbound rules use source IPs, not destination IPs, and the goal is to block outbound traffic.
One commenter voted C, saying “traffic is going out from EC2, need to identify the source,” but this misunderstands NACL outbound rule fields. While the source EC2 instance is indeed where the traffic originates, a NACL cannot match on source for egress traffic; it matches on destination. The commenter also suggested attaching an outbound constraint to the subnet ACL, which is correct in direction but uses the wrong IP field.
Community Comment Notes
A highly-liked comment explains A succinctly: adding a NACL outbound rule stops traffic from the VPC where it's generated, using the destination address because “only IP settable for outbound rules.” Another liked comment highlights the combination of destination IPs and outbound rules as the correct automation. The minority C voters focused on the source EC2 instance, but they missed the technical limitation of NACL outbound rules. The majority consensus (71%) chose A, and the correct AWS documentation confirms that outbound rules filter based on destination IP.
Overall, the key to this question is remembering that NACLs are stateless and each direction has a different set of filter fields. For egress traffic, you must use an outbound rule with a destination IP.
Official Reference
- https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html
- https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs-tgw.html
- https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html
These links open the official vendor documentation in a new tab.
Exam Strategy
On exam day, immediately identify the traffic direction in the scenario. If traffic is leaving a VPC or subnet, focus on outbound NACL rules and destination IPs. If traffic is entering, focus on inbound rules and source IPs. This will help you eliminate options C and D quickly.
Community Votes
71% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 4 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 4
-
woorkim 👍 3 Answered AIt uses destination IP addresses, which identify where the problematic traffic is trying to go It creates outbound rules, which prevent traffic from leaving the VPC This combination will effectively block traffic to the identified problematic destinations The solution maintains proper traffic flow direction matching between the identified problems and the blocking mechanism It can be automated through Lambda based on the SNS notifications
-
c1193d4 👍 2 Answered AA: add a NACL outbound rule to stop the traffic from the VPC where it's generated - use the destination address (only IP settable for outbound rules)
-
ashk123456 👍 1 Answered CThe goal is to prevent traffic identified in SNS notifications from leaving the VPC. The correct approach is to: 1. Identify the source IP addresses of the unwanted traffic. 2. Use a network ACL (NACL) to block outbound traffic from these source IPs in the transit gateway attachment subnets.
-
youonebe 👍 1 Answered CAnswer is C. Traffic is going out from EC2, need to identify the source and attach outbound constrain to the subnet ACL.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All ANS-C01 Questions
Access 137 questions with complete answers and detailed explanations.
View Full ANS-C01 Practice Test →