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.

 

Fig 1

 

  • Under Compute select EC2.

 

Fig 2

 

  • Click on Security Groups.

 

Fig. 3

 

 

  • Click on Create Security Group.

 

Fig. 4

 

  • Provide Security Group Name & Description is required.
  • Select Default or Existing VPC.
  • At Inbound click on Add Rule.

 

Fig. 5

 

  • Then select Inbound rule type like HTTP,HTTPS or SSH.
  • Select Source & Provide IP address.

 

Fig. 6

 

  • 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.

 

Fig. 7

 

  • After sometime security group is ready.

 

Fig. 7

 

  • Click on Actions.
  • Select Add/Edit Tags.

 

Fig. 8

 

  • Click on Create Tag.

 

Fig 9

 

  • Provide the key name & value for security group.
  • Click on save.

 

Fig 10

 

 

Create Security Group using Shell

aws ec2 create-security-group –group-name security_group_name –description “example” –vpc-id  vpc_id

 

Leave a Reply