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
-
SSH Access:
- Type: SSH
- Source: Your IP address
- Purpose: Enable SSH connection to EC2 instances
-
ICMP Access:
- Type: All ICMP - IPv4
- Source: Anywhere (0.0.0.0/0)
- Purpose: Allow ping between instances
-
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
- Access the AWS Management Console
- Search for VPC service
- Select VPC

- Navigate to Security Groups
- Select Security Groups from the left sidebar
- Click Create Security Group

- Configure Basic Details
- Security group name: MY VPC SG
- Description: Security group for My VPC instances
- VPC: Select My VPC

- 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
- Review configuration
- Click Create security group

- Verify Creation
- Confirm successful creation
- Note the security group ID

- 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)

- 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 HG VPC Security Group
- Review configuration
- Click Create security group

- Verify HG VPC Security Group
- Confirm successful creation
- Note the security group ID

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