Skip to content

Commit

Permalink
Add ICMP ingress rules for EC2s
Browse files Browse the repository at this point in the history
  • Loading branch information
Syuqri authored and Syuqri committed Dec 29, 2023
1 parent aad9d5c commit 1e4daff
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ resource "aws_security_group" "first_instance_sg" {
name = "first_instance_sg"
vpc_id = aws_vpc.main.id

ingress = [
{
description = "Allow ICMP"
from_port = 8
to_port = 0
protocol = "icmp"
cidr_blocks = [aws_subnet.second.cidr_block]
ipv6_cidr_blocks = []
prefix_list_ids = []
security_groups = []
self = false
}
]

egress {
from_port = 0
to_port = 0
Expand Down Expand Up @@ -70,6 +84,20 @@ resource "aws_security_group" "second_instance_sg" {
name = "second_instance_sg"
vpc_id = aws_vpc.main.id

ingress = [
{
description = "Allow ICMP"
from_port = 8
to_port = 0
protocol = "icmp"
cidr_blocks = [aws_subnet.first.cidr_block]
ipv6_cidr_blocks = []
prefix_list_ids = []
security_groups = []
self = false
}
]

egress {
from_port = 0
to_port = 0
Expand Down

0 comments on commit 1e4daff

Please sign in to comment.