How Many Security Groups Are There in an Ec2 Instance

How Many Security Groups Are There in an Ec2 Instance

A security group acts as a virtual firewall for your EC2 instances to control inbound and outbound traffic. When you launch an EC2 instance in a VPC, you can assign up to five security groups to the instance. Security groups act at the instance level, not the subnet level.

Can an EC2 instance have multiple security groups?

You can apply multiple security groups to a single EC2 instance or apply a single security group to multiple EC2 instances. System administrators often make changes to the state of the ports; however, when multiple security groups are applied to one instance, there is a higher chance of overlapping security rules.

What is the maximum number of security groups that can be applied to any one EC2 instance?

You can assign up to 5 security groups to a network interface. If you need to increase or decrease this limit, you can contact AWS Support.

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.