In AWS, a security group represents a virtual firewall that controls inbound and outbound traffic for instances. It works at the instance level, but not at the subnet level. This is the reason we can associate multiple security groups with one subnet.
When we define VPC and subnets, by default, a security group is created. You can also create your own multiple security groups as per your need.
You can see the details of security groups in the VPC section in AWS Management Console:
Whenever we create a VPC, it automatically creates a default security group that can be customized. Apart from that, we can also create multiple ...