-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsg.tf
More file actions
65 lines (55 loc) · 1.17 KB
/
sg.tf
File metadata and controls
65 lines (55 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Security group for east instance
resource "aws_security_group" "allow_ping_east" {
name = "allow_ping_east"
description = "Allow ping traffic"
vpc_id = aws_vpc.vpc_us_east.id
ingress {
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = [var.WEST]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = [var.EAST]
}
egress {
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = [var.WEST]
}
tags = {
Name = "allow-ping-east"
}
}
# Security group for west instance
resource "aws_security_group" "allow_ping_west" {
name = "allow_ping_west"
description = "Allow ping traffic"
vpc_id = aws_vpc.vpc_us_west.id
provider = aws.us-west
ingress {
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = [var.EAST]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = [var.WEST]
}
egress {
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = [var.EAST]
}
tags = {
Name = "allow-ping-west"
}
}