Which AWS service or tool can be used to set up a firewall to control traffic going into and coming out of an Amazon VPC subnet?
Security group
AWS WAF
AWS Firewall Manager
Network ACL
Explanations:
Security groups act as virtual firewalls for EC2 instances to control inbound and outbound traffic. However, they are stateful and operate at the instance level rather than at the subnet level.
AWS WAF (Web Application Firewall) is used to protect web applications from common web exploits but does not control traffic at the VPC or subnet level. It operates at the application layer and is not a firewall for VPC subnets.
AWS Firewall Manager is a security management service that simplifies the administration of firewalls across accounts and applications but does not itself create firewall rules for controlling traffic in a VPC subnet directly.
Network ACLs (Access Control Lists) are used to set up firewall rules for controlling traffic in and out of a subnet in a VPC. They are stateless and provide an additional layer of security at the subnet level.