What is a Security Group?
A security group in AWS is a stateful virtual firewall attached to an EC2 instance or other AWS resource’s network interface. It controls which inbound and outbound traffic is allowed based on protocol, port, and source or destination.