-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.tf
More file actions
100 lines (94 loc) · 2.16 KB
/
main.tf
File metadata and controls
100 lines (94 loc) · 2.16 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
resource "cloudstack_vpc" "my_own_private_cloud" {
name = "my_own_private_cloud"
cidr = "10.10.0.0/22"
vpc_offering = "${var.vpc_offering}"
zone = "${var.zone}"
project = "${var.project}"
}
resource "cloudstack_network_acl" "acl_web" {
name = "acl_web"
vpc = "${cloudstack_vpc.my_own_private_cloud.id}"
}
resource "cloudstack_network_acl_rule" "acl_web_tier" {
aclid = "${cloudstack_network_acl.acl_web.id}"
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "tcp"
ports = [ "53", "80", "123", "443" ]
traffic_type = "egress"
}
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "udp"
ports = [ "53", "123" ]
traffic_type = "egress"
}
rule {
action = "allow"
source_cidr = "${cloudstack_instance.mysql01.ipaddress}/32"
protocol = "tcp"
ports = [ "3306" ]
traffic_type = "egress"
}
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "icmp"
traffic_type = "egress"
}
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "tcp"
ports = [ "80", "443" ]
traffic_type = "ingress"
}
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "icmp"
traffic_type = "ingress"
}
}
resource "cloudstack_network_acl" "acl_db" {
name = "acl_db"
vpc = "${cloudstack_vpc.my_own_private_cloud.id}"
}
resource "cloudstack_network_acl_rule" "acl_db_tier" {
aclid = "${cloudstack_network_acl.acl_db.id}"
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "tcp"
ports = [ "53", "80", "123", "443" ]
traffic_type = "egress"
}
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "udp"
ports = [ "53", "123" ]
traffic_type = "egress"
}
rule {
action = "allow"
source_cidr = "${cloudstack_instance.wordpress01.ipaddress}/32"
protocol = "tcp"
ports = [ "3306" ]
traffic_type = "ingress"
}
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "icmp"
traffic_type = "egress"
}
rule {
action = "allow"
source_cidr = "0.0.0.0/0"
protocol = "icmp"
traffic_type = "ingress"
}
}