Create Security Group

Create Security Group

ℹ️ Information: This step details how to create My VPC SG using CloudFormation Template. You can repeat this step to create HG VPC SG.

💡 Pro Tip: Security Groups act as virtual firewalls for your instances to control inbound and outbound traffic.

Required Inbound Rules

  1. SSH Access:

    • Type: SSH
    • Source: Your IP address
    • Purpose: Enable SSH connection to EC2 instances
  2. ICMP Access:

    • Type: All ICMP - IPv4
    • Source: Anywhere (0.0.0.0/0)
    • Purpose: Allow ping between instances
  3. VPC Peering Access:

    • Type: All ICMP - IPv4
    • Source: Custom CIDR (10.10.0.0/16 for HG VPC)
    • Purpose: Enable communication between peered VPCs

Implementation Steps

  1. Access the AWS Management Console
    • Search for VPC service
    • Select VPC

Create Security Group

  1. Navigate to Security Groups
    • Select Security Groups from the left sidebar
    • Click Create Security Group

Create Security Group

  1. Configure Basic Details
    • Security group name: MY VPC SG
    • Description: Security group for My VPC instances
    • VPC: Select My VPC

Create Security Group

  1. Configure Inbound Rules
    • Add rule for SSH (Source: My IP)
    • Add rule for All ICMP - IPv4 (Source: Anywhere)
    • Add rule for All ICMP - IPv4 (Source: Custom 10.10.0.0/16)

Create Security Group

  1. Create Security Group
    • Review configuration
    • Click Create security group

Create Security Group

  1. Verify Creation
    • Confirm successful creation
    • Note the security group ID

Create Security Group

  1. Create HG VPC Security Group
    • Repeat steps 1-6 with the following changes:
      • Name: HG VPC SG
      • VPC: HG VPC
      • Custom CIDR: 172.31.0.0/16 (My VPC’s CIDR)

Create Security Group

  1. Configure HG VPC Inbound Rules
    • SSH (Source: My IP)
    • All ICMP - IPv4 (Source: Anywhere)
    • All ICMP - IPv4 (Source: Custom 172.31.0.0/16)

Create Security Group

  1. Create HG VPC Security Group
    • Review configuration
    • Click Create security group

Create Security Group

  1. Verify HG VPC Security Group
    • Confirm successful creation
    • Note the security group ID

Create Security Group

🔒 Security Note: Always follow the principle of least privilege when configuring security group rules. Only allow necessary traffic between instances.

⚠️ Warning: Ensure that security group rules are properly configured before launching instances. Incorrect configurations can lead to connectivity issues.