Create Security Group

Create a Security Group for a Server in a Public Subnet

  1. In the VPC interface:
    • Select Security Group
    • Select Create Security Group

ConnectPrivate

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

ConnectPrivate

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

ConnectPrivate

  1. Check Outbound rules and select Create security group

ConnectPrivate

ConnectPrivate

  1. Complete the creation of the security group for the server located in the public subnet

ConnectPrivate

Create a Security Group for a Server in a Private Subnet

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

ConnectPrivate

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

ConnectPrivate

  1. Then click Create security group

ConnectPrivate

  1. Two Security Groups have been created for servers located in the public and private subnets:
    • Next, we will proceed to create two EC2 servers.