Create Security Group
Create a Security Group for a Server in a Public Subnet
- In the VPC interface:
- Select Security Group
- Select Create Security Group
- In the Create Security Group interface:
- Security Group Name: Enter
Public Subnet SG
- Description: Enter
Allow SSH and Ping for servers in the public subnet
.
- Select workshop-vpc VPC
- Configure Inbound rules:
- In Inbound rules, click Add rule.
- Select Type: SSH and Source: My IP. (Use your public IPv4 address)
- Select Add rule to add a new rule.
- Select Type: All ICMP - IPv4 and Source: Anywhere. Allow ping from any IP address.
- Check Outbound rules and select Create security group
- Complete the creation of the security group for the server located in the public subnet
Create a Security Group for a Server in a Private Subnet
- In the VPC interface:
- Select Security Groups
- Select Create security group
- Security Group Name: Enter
Private Subnet SG
- Description: Enter
Allow SSH and Ping for servers in the private subnet
.
- Select workshop-vpc VPC
- Configure Inbound rules:
- In Inbound rules, select Add rule.
- Select Type: SSH and leave Source: Custom. Search and select Public Subnet SG to allow SSH from servers in the public subnet.
- Select Add rule to add a new rule
- Select Type: All ICMP IPv4 and Source: Anywhere. Allow ping from any IP address.
- Then click Create security group
- Two Security Groups have been created for servers located in the public and private subnets:
- Next, we will proceed to create two EC2 servers.