Preventing Dropped TGW Traffic with Network ACLs and Lambda

A company has a transit gateway in a single AWS account. The company sends flow logs for the transit gateway to an Amazon CloudWatch Logs log group. The company created an AWS Lambda function to analyze the logs. The Lambda function sends a notification to an Amazon Simple Notification Service (Amazon SNS) topic when a VPC generates traffic that is dropped by the transit gateway. Each notification contains the account ID. VPC ID, and total amount of dropped packets. The company wants to subscribe a new Lambda function to the SNS topic. The new Lambda function must automatically prevent the traffic that is identified in each notification from leaving a VPC by applying a network ACL to the transit gateway attachment subnets in the VPC that generates the traffic. Which solution will meet these requirements?

  1. 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. Source Reference Answer
  2. Configure the existing Lambda function to add the source IP addresses of the dropped traffic to each SNS notification. Configure the new Lambda function to create an inbound rule by using the source IP addresses in the network ACL.
  3. Configure the existing Lambda function to add the source IP addresses of the dropped traffic to each SNS notification. Configure the new Lambda function to create an outbound rule by using the source IP addresses in the network ACL.
  4. 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 inbound rule by using the destination IP addresses in the network ACL.

Community Votes

A
71%
C
29%

71% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

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.

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.

Community Discussion (4 comments)

ashk123456 👍 1 Selected: C
The 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 Selected: C
Answer is C. Traffic is going out from EC2, need to identify the source and attach outbound constrain to the subnet ACL.
woorkim 👍 3 Selected: A
It 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 Selected: A
A: 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)

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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

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.

Related Analysis

Practice All ANS-C01 Questions

Access 137 questions with complete answers and detailed explanations.

View Full ANS-C01 Practice Test →

← Back to ANS-C01 Study Guide