Which AWS service or feature can be used to control inbound and outbound traffic on an Amazon EC2 instance?
Internet gateways
AWS Identity and Access Management (IAM)
Network ACLs
Security groups
Explanations:
Internet gateways allow communication between instances in a VPC and the internet, not controlling traffic flow.
IAM manages access to AWS resources and permissions, not traffic control on instances.
Network ACLs control traffic at the subnet level, not directly on individual instances.
Security groups control inbound and outbound traffic specifically for individual Amazon EC2 instances.