Create Security Group

VPC Security Group

A subnet group is a collection of subnets running on Amazon Virtual Private Cloud (VPC) environment, allows you configure inbound and outbound rules

Create VPC Security Groups

In this step, we will create two Security Groups (SGs): one for public subnets (used by EC2 instances) and one for private subnets (used by RDS instances).

  • Go to the VPC Service. In the left-hand menu, select Security Groups. Click Create Security Group.
  • Create the following two Security Groups:
Subnet NameDirectionProtocolPort RangeSource/Destination
public-sgInboundSSH (TCP)22My IP Address
public-sgInboundICMPAll0.0.0.0/0
public-sgInboundTCPAll0.0.0.0/0
public-sgInboundHTTPAll0.0.0.0/0
public-sgInboundHTTPSAll0.0.0.0/0
public-sgOutboundAllAll0.0.0.0/0
private-sgInboundMySQL (TCP)33060.0.0.0/0
private-sgOutboundAllAll0.0.0.0/0

2.1. Create Public SG

  • In the Create Security Group interface, fill out the Basic Details for public-sg.
  • Add the Inbound Rules for public-sg as shown above.
  • Allow all Outbound traffic.
  • Click Create Security Group. public-sg

2.2. Create Private SG

  • In the Create Security Group interface, fill out the Basic Details for private-sg.
  • Add the Inbound Rules for private-sg as shown above.
  • Allow all Outbound traffic.
  • Click Create Security Group. private-sg.png