1
- variable "elb_idle_timeout" {
2
- type = number
3
- default = 60
4
- }
5
-
6
- resource "aws_security_group" "cf_ssh_lb_security_group" {
7
- name = " ${ var . env_id } -cf-ssh-lb-security-group"
8
- description = " CF SSH"
9
- vpc_id = local. vpc_id
10
-
11
- ingress {
12
- cidr_blocks = [" 0.0.0.0/0" ]
13
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
14
- protocol = " tcp"
15
- from_port = 2222
16
- to_port = 2222
17
- }
18
-
19
- egress {
20
- from_port = 0
21
- to_port = 0
22
- protocol = " -1"
23
- cidr_blocks = [" 0.0.0.0/0" ]
24
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
25
- }
26
-
27
- tags = {
28
- Name = " ${ var . env_id } -cf-ssh-lb-security-group"
29
- }
30
-
31
- lifecycle {
32
- ignore_changes = [name ]
33
- }
34
- }
35
-
36
- output "cf_ssh_lb_security_group" {
37
- value = aws_security_group. cf_ssh_lb_security_group . id
38
- }
39
-
40
- resource "aws_security_group" "cf_ssh_lb_internal_security_group" {
41
- name = " ${ var . env_id } -cf-ssh-lb-internal-security-group"
42
- description = " CF SSH Internal"
43
- vpc_id = local. vpc_id
44
-
45
- ingress {
46
- security_groups = [" ${ aws_security_group . cf_ssh_lb_security_group . id } " ]
47
- protocol = " tcp"
48
- from_port = 2222
49
- to_port = 2222
50
- }
51
-
52
- egress {
53
- from_port = 0
54
- to_port = 0
55
- protocol = " -1"
56
- cidr_blocks = [" 0.0.0.0/0" ]
57
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
58
- }
59
-
60
- tags = {
61
- Name = " ${ var . env_id } -cf-ssh-lb-internal-security-group"
62
- }
63
-
64
- lifecycle {
65
- ignore_changes = [name ]
66
- }
67
- }
68
-
69
- output "cf_ssh_lb_internal_security_group" {
70
- value = aws_security_group. cf_ssh_lb_internal_security_group . id
71
- }
72
-
73
1
resource "aws_elb" "cf_ssh_lb" {
74
2
name = " ${ var . short_env_id } -cf-ssh-lb"
75
3
cross_zone_load_balancing = true
@@ -107,88 +35,6 @@ output "cf_ssh_lb_url" {
107
35
value = aws_elb. cf_ssh_lb . dns_name
108
36
}
109
37
110
- resource "aws_security_group" "cf_router_lb_security_group" {
111
- name = " ${ var . env_id } -cf-router-lb-security-group"
112
- description = " CF Router"
113
- vpc_id = local. vpc_id
114
-
115
- ingress {
116
- cidr_blocks = [" 0.0.0.0/0" ]
117
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
118
- protocol = " tcp"
119
- from_port = 80
120
- to_port = 80
121
- }
122
-
123
- ingress {
124
- cidr_blocks = [" 0.0.0.0/0" ]
125
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
126
- protocol = " tcp"
127
- from_port = 443
128
- to_port = 443
129
- }
130
-
131
- ingress {
132
- cidr_blocks = [" 0.0.0.0/0" ]
133
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
134
- protocol = " tcp"
135
- from_port = 4443
136
- to_port = 4443
137
- }
138
-
139
- egress {
140
- from_port = 0
141
- to_port = 0
142
- protocol = " -1"
143
- cidr_blocks = [" 0.0.0.0/0" ]
144
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
145
- }
146
-
147
- tags = {
148
- Name = " ${ var . env_id } -cf-router-lb-security-group"
149
- }
150
-
151
- lifecycle {
152
- ignore_changes = [name ]
153
- }
154
- }
155
-
156
- output "cf_router_lb_security_group" {
157
- value = aws_security_group. cf_router_lb_security_group . id
158
- }
159
-
160
- resource "aws_security_group" "cf_router_lb_internal_security_group" {
161
- name = " ${ var . env_id } -cf-router-lb-internal-security-group"
162
- description = " CF Router Internal"
163
- vpc_id = local. vpc_id
164
-
165
- ingress {
166
- security_groups = [" ${ aws_security_group . cf_router_lb_security_group . id } " ]
167
- protocol = " tcp"
168
- from_port = 80
169
- to_port = 80
170
- }
171
-
172
- egress {
173
- from_port = 0
174
- to_port = 0
175
- protocol = " -1"
176
- cidr_blocks = [" 0.0.0.0/0" ]
177
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
178
- }
179
-
180
- tags = {
181
- Name = " ${ var . env_id } -cf-router-lb-internal-security-group"
182
- }
183
-
184
- lifecycle {
185
- ignore_changes = [name ]
186
- }
187
- }
188
-
189
- output "cf_router_lb_internal_security_group" {
190
- value = aws_security_group. cf_router_lb_internal_security_group . id
191
- }
192
38
193
39
resource "aws_elb" "cf_router_lb" {
194
40
name = " ${ var . short_env_id } -cf-router-lb"
@@ -235,21 +81,6 @@ resource "aws_elb" "cf_router_lb" {
235
81
}
236
82
}
237
83
238
- resource "aws_lb_target_group" "cf_router_4443" {
239
- name = " ${ var . short_env_id } -routertg-4443"
240
- port = 4443
241
- protocol = " TCP"
242
- vpc_id = local. vpc_id
243
-
244
- health_check {
245
- protocol = " TCP"
246
- }
247
-
248
- tags = {
249
- Name = " ${ var . env_id } "
250
- }
251
- }
252
-
253
84
output "cf_router_lb_name" {
254
85
value = aws_elb. cf_router_lb . name
255
86
}
@@ -258,80 +89,6 @@ output "cf_router_lb_url" {
258
89
value = aws_elb. cf_router_lb . dns_name
259
90
}
260
91
261
- resource "aws_security_group" "cf_tcp_lb_security_group" {
262
- name = " ${ var . env_id } -cf-tcp-lb-security-group"
263
- description = " CF TCP"
264
- vpc_id = local. vpc_id
265
-
266
- ingress {
267
- cidr_blocks = [" 0.0.0.0/0" ]
268
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
269
- protocol = " tcp"
270
- from_port = 1024
271
- to_port = 1123
272
- }
273
-
274
- egress {
275
- from_port = 0
276
- to_port = 0
277
- protocol = " -1"
278
- cidr_blocks = [" 0.0.0.0/0" ]
279
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
280
- }
281
-
282
- tags = {
283
- Name = " ${ var . env_id } -cf-tcp-lb-security-group"
284
- }
285
-
286
- lifecycle {
287
- ignore_changes = [name ]
288
- }
289
- }
290
-
291
- output "cf_tcp_lb_security_group" {
292
- value = aws_security_group. cf_tcp_lb_security_group . id
293
- }
294
-
295
- resource "aws_security_group" "cf_tcp_lb_internal_security_group" {
296
- name = " ${ var . env_id } -cf-tcp-lb-internal-security-group"
297
- description = " CF TCP Internal"
298
- vpc_id = local. vpc_id
299
-
300
- ingress {
301
- security_groups = [" ${ aws_security_group . cf_tcp_lb_security_group . id } " ]
302
- protocol = " tcp"
303
- from_port = 1024
304
- to_port = 1123
305
- }
306
-
307
- ingress {
308
- security_groups = [" ${ aws_security_group . cf_tcp_lb_security_group . id } " ]
309
- protocol = " tcp"
310
- from_port = 80
311
- to_port = 80
312
- }
313
-
314
- egress {
315
- from_port = 0
316
- to_port = 0
317
- protocol = " -1"
318
- cidr_blocks = [" 0.0.0.0/0" ]
319
- ipv6_cidr_blocks = var. dualstack ? [" ::/0" ] : null
320
- }
321
-
322
- tags = {
323
- Name = " ${ var . env_id } -cf-tcp-lb-security-group"
324
- }
325
-
326
- lifecycle {
327
- ignore_changes = [name ]
328
- }
329
- }
330
-
331
- output "cf_tcp_lb_internal_security_group" {
332
- value = aws_security_group. cf_tcp_lb_internal_security_group . id
333
- }
334
-
335
92
resource "aws_elb" "cf_tcp_lb" {
336
93
name = " ${ var . short_env_id } -cf-tcp-lb"
337
94
cross_zone_load_balancing = true
0 commit comments