-
Notifications
You must be signed in to change notification settings - Fork 0
/
sg.tf
151 lines (115 loc) · 3.99 KB
/
sg.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
data "http" "0" {
url = "https://ipv4.icanhazip.com"
}
resource "aws_security_group" "0" {
name = "${local.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
}
resource "aws_security_group_rule" "egress" {
type = "egress"
from_port = 0
to_port = 0
protocol = -1
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
}
resource "aws_security_group_rule" "ingress_any_port" {
type = "ingress"
from_port = 0
to_port = 0
protocol = -1
cidr_blocks = ["${compact(concat(list("${local.current_ip}/32"), var.whitelist))}"]
security_group_id = "${aws_security_group.0.id}"
}
resource "aws_security_group_rule" "ingress_world_port_0" {
type = "ingress"
from_port = "${local.ingress_world_port_0}"
to_port = "${local.ingress_world_port_0}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_0_count}"
}
resource "aws_security_group_rule" "ingress_world_port_1" {
type = "ingress"
from_port = "${local.ingress_world_port_1}"
to_port = "${local.ingress_world_port_1}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_1_count}"
}
resource "aws_security_group_rule" "ingress_world_port_2" {
type = "ingress"
from_port = "${local.ingress_world_port_2}"
to_port = "${local.ingress_world_port_2}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_2_count}"
}
resource "aws_security_group_rule" "ingress_world_port_3" {
type = "ingress"
from_port = "${local.ingress_world_port_3}"
to_port = "${local.ingress_world_port_3}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_3_count}"
}
resource "aws_security_group_rule" "ingress_world_port_4" {
type = "ingress"
from_port = "${local.ingress_world_port_4}"
to_port = "${local.ingress_world_port_4}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_4_count}"
}
resource "aws_security_group_rule" "ingress_world_port_5" {
type = "ingress"
from_port = "${local.ingress_world_port_5}"
to_port = "${local.ingress_world_port_5}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_5_count}"
}
resource "aws_security_group_rule" "ingress_world_port_6" {
type = "ingress"
from_port = "${local.ingress_world_port_6}"
to_port = "${local.ingress_world_port_6}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_6_count}"
}
resource "aws_security_group_rule" "ingress_world_port_7" {
type = "ingress"
from_port = "${local.ingress_world_port_7}"
to_port = "${local.ingress_world_port_7}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_7_count}"
}
resource "aws_security_group_rule" "ingress_world_port_8" {
type = "ingress"
from_port = "${local.ingress_world_port_8}"
to_port = "${local.ingress_world_port_8}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_8_count}"
}
resource "aws_security_group_rule" "ingress_world_port_9" {
type = "ingress"
from_port = "${local.ingress_world_port_9}"
to_port = "${local.ingress_world_port_9}"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.0.id}"
count = "${local.ingress_world_port_9_count}"
}