Which AWS service or feature will meet this requirement?
Network ACLs
AWS WAF
Amazon GuardDuty
Security groups
Explanations:
Network ACLs are stateless and operate at the subnet level. They control traffic in and out of a subnet but are not suitable for controlling traffic between specific EC2 instances.
AWS WAF (Web Application Firewall) is designed to protect web applications from common web exploits. It is not used for controlling network traffic between EC2 instances.
Amazon GuardDuty is a threat detection service that continuously monitors for malicious activity and unauthorized behavior. It does not control network traffic.
Security groups are stateful virtual firewalls for controlling inbound and outbound traffic to AWS resources, such as EC2 instances. They allow fine-grained control of traffic between specific instances.