Network Security Group
Security groups are associated with the following:
EC2 instances
Elastic Network Interfaces (ENIs)
Security groups can't do deny rules. Instead use NACLs to block IP ranges.
A network security group is not directly associated with a subnet, VPN, Availability Zone (AZ), or Region. Instead,
To clarify:
Security groups operate at the instance level, not at the subnet level.
They can be applied to instances in any subnet, AZ, or VPC within a region.
Multiple instances across different subnets or AZs can use the same security group.
Security groups are specific to a VPC and region. You can't use a security group from one region or VPC in another.
It's important to note that while security groups are not associated with subnets, there is a similar concept called Network Access Control Lists (NACLs) that do operate at the subnet level.
Key differences:
Security Groups: Instance-level firewall, stateful
NACLs: Subnet-level firewall, stateless
Last updated
Was this helpful?