- HX Club
- April 6, 2022
How to Create Security Groups on Amazon Web Service (AWS)
A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic. If you don’t specify a security group, Amazon EC2 uses the default security group. You can add rules to each security group that allow traffic to or from its associated instances.
- Login to aws portal.
- Click on Services.
- Under Compute select EC2.
- Click on Security Groups.
- Click on Create Security Group.
- Provide Security Group Name & Description is required.
- Select Default or Existing VPC.
- At Inbound click on Add Rule.
- Then select Inbound rule type like HTTP,HTTPS or SSH.
- Select Source & Provide IP address.
- At Outbound click Add rule.
- Then select Outbound rule type like All traffic.
- Select Destination & Provide IP address.
- We can Add or edit Inbound/Outbound Rules after security group is created.
- Click on Create.
- After sometime security group is ready.
- Click on Actions.
- Select Add/Edit Tags.
- Click on Create Tag.
- Provide the key name & value for security group.
- Click on save.
Create Security Group using Shell
- Setup aws-cli on your system so click on link https://www.hackerxone.com/blog/how-install-configure-aws-cli-ubuntu-1804
- Run the following command:
aws ec2 create-security-group –group-name security_group_name –description “example” –vpc-id vpc_id