-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnacl.tf
87 lines (75 loc) · 1.7 KB
/
nacl.tf
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#-----------------------------------------------
# All Network ACLs are described in this file
#-----------------------------------------------
# Public Subnet ACLs
resource "aws_network_acl" "public_acl" {
vpc_id = "${aws_vpc.wordpress_vpc.id}"
subnet_ids = ["${aws_subnet.public1.id}","${aws_subnet.public2.id}"]
ingress {
protocol = "tcp"
rule_no = 100
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 65535
}
egress {
protocol = "tcp"
rule_no = 100
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 65535
}
tags {
Name = "public_nacl"
}
}
# Application Subnet ACLs
resource "aws_network_acl" "app_acl" {
vpc_id = "${aws_vpc.wordpress_vpc.id}"
subnet_ids = ["${aws_subnet.app1.id}", "${aws_subnet.app2.id}"]
ingress {
protocol = "tcp"
rule_no = 100
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 65535
}
egress {
protocol = "tcp"
rule_no = 100
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 65535
}
tags {
Name = "app_nacl"
}
}
# Database subnet ACLs
resource "aws_network_acl" "db_acl" {
vpc_id = "${aws_vpc.wordpress_vpc.id}"
subnet_ids = ["${aws_subnet.db1.id}","${aws_subnet.db2.id}"]
ingress {
protocol = "tcp"
rule_no = 100
action = "allow"
cidr_block = "${aws_vpc.wordpress_vpc.cidr_block}"
from_port = 0
to_port = 65535
}
egress {
protocol = "tcp"
rule_no = 100
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 65535
}
tags {
Name = "db_nacl"
}
}