One option is to use the describe-vpc-endpoints call with these filters:
vpc-endpoint-type = GatewayLoadBalancer vpc-id = <The ID of the VPC you want to check> tag = Name=AWSNetworkFirewallManaged,Values=true
If you get a result, it means there's an AWS Network Firewall in the VPC. It however doesn't imply that it's being used. You'll need to check the subnet route tables for that.
We dont have direct options to check the VPC associated with AWS Network Firewall. We will be able to see it from VPC route table whether they have routes to Network Firewall endpoint to inspect the traffic. However, If you have multiple VPCs that are connected via Transit Gateway and you have one AWS Network Firewall as centralized Egress inspection, you will not see all VPC route tables pointing to AWS Network Firewall Endpoints.
Other Options:- Assumptions:- All VPCs are connected via AWS Transit Gateway and Centralized Egress inspection.
- you can check all VPC's route table has default route (0.0.0.0/0-- TGW )
- on the Transit gateway route table, ensure default route 0.0.0.0/0 points to Inspection VPC TGW attachment (Inspection VPC --where you host AWS Network Firewall)
- In the Inspection VPC's route table, where you have TGW ENI, check for default route 0.0.0.0/0 points to AWS Network Firewall Endpoint.
Please refer this blog
Restricting IPs for Lambda functions connected to VPCsAccepted Answerasked 2 years ago
AWS Client VPN - my systems are in different subnets that are in different VPCsasked a year ago
Network Firewallasked 6 months ago
When I create a VPC can I attach a Network Firewall to it upon creation?
Not able to delete VPCs, Subnets, SGs, and Network Interfacesasked 2 years ago
How do I confirm a route table is using a network firewall, opposed to just showing it's using a vpc endpoint?
How does the Route 53 Resolver share endpoints across multiple accounts and VPCs?Accepted Answerasked 4 years ago
Is there an API call I can make to multiple VPCs that will return the network firewalls associated with it?asked 2 months ago
(Boto3) How can I call the VPC Route tables to return an indication that a Network Firewall is being used?
enable communication between multiple VPCs from a single VPN connection attached to my transit gatewayasked 6 months ago