To change an AWS EC2 instance’s security group, open the Amazon EC2 Console and Select “Instances.” Click “Change Security Groups” under “Actions” and select the security group to assign an instance. You can remove pre-existing security groups by choosing “Remove” then save.
Security groups control traffic within an EC2 according to preset inbound and outbound rules. They provide instance-level security, and you can apply them to one or more instances. There should be one instance associated with at least one security group.
Security groups consist of a set of rules that manage both inbound and outbound traffic on instances. Ideally, they function like virtual firewalls and should form a defense for existing instances.
AWS automatically assigns a default security group upon launching EC2 instances in Virtual Private Cloud (VPC). Security groups apply to the instances assigned by the user during launch or after creating the instance. You can either add rules to the default security group or delete them entirely.
How to Create a New Security Group
You can create a security group through the AWS Management Console. In the console, select ‘‘Security Groups” followed by the “Create Security Group” button.
Create a default security group name and add a description saying how you intend to use the security group. A unique name helps to distinguish it from other security groups. After adding a short description, make sure you assign it to a specific VPC where it will reside.
Once you have entered the basic details, configure both inbound and outbound rules.
Best Practices for AWS EC2 Instances’ Security Groups
Review Security Groups Associated with Instances
Categorize Security Groups
Restrict Access to EC2 Security Groups
Minimize Use of Multiple Security Groups
Cost Optimize with nOps
If you’re looking to improve cost efficiency, visibility and reporting for AWS, nOps can help.
nOps is an end-to-end AWS Cost Optimization Platform that simplifies and automates the management of your cloud resources, commitments, and costs.
nOps integrates with all of your AWS, multicloud, Kubernetes, GenAI, and SaaS costs, making it easy to start automatically improving your visibility and efficiency.
We manage $2 billion in AWS spend and were recently ranked #1 in G2’s Cloud Cost Management category — book a demo to connect your AWS account and see how much you can save.