Skip to content

Commit 0650611

Browse files
committed
fixes
1 parent 28cf8e3 commit 0650611

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

modules/metadata-service/ec2.tf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ resource "aws_lb" "alb" {
161161
load_balancer_type = "application"
162162
idle_timeout = 180 # 3 minutes
163163
subnets = [var.subnet1_id, var.subnet2_id]
164-
security_groups = [aws_security_group.metadata_alb_security_group[0].id]
164+
security_groups = [aws_security_group.metadata_alb_security_group.id]
165165

166166
tags = var.standard_tags
167167
}
@@ -208,24 +208,24 @@ resource "aws_lb_target_group" "alb_db_migrate" {
208208
}
209209

210210
resource "aws_lb_listener" "alb_main" {
211-
load_balancer_arn = aws_lb.alb[0].arn
211+
load_balancer_arn = aws_lb.alb.arn
212212
port = "80"
213213
protocol = "HTTP"
214214

215215
default_action {
216216
type = "forward"
217-
target_group_arn = aws_lb_target_group.alb_main[0].arn
217+
target_group_arn = aws_lb_target_group.alb_main.arn
218218
}
219219
}
220220

221221
resource "aws_lb_listener" "alb_db_migrate" {
222-
load_balancer_arn = aws_lb.alb[0].arn
222+
load_balancer_arn = aws_lb.alb.arn
223223
port = "8082"
224224
protocol = "HTTP"
225225

226226
default_action {
227227
type = "forward"
228-
target_group_arn = aws_lb_target_group.alb_db_migrate[0].arn
228+
target_group_arn = aws_lb_target_group.alb_db_migrate.arn
229229
}
230230
}
231231

@@ -256,8 +256,8 @@ resource "aws_lb_target_group" "apigw_metadata" {
256256
}
257257

258258
resource "aws_lb_target_group_attachment" "apigw_metadata" {
259-
target_group_arn = aws_lb_target_group.apigw_metadata[0].arn
260-
target_id = aws_lb.alb[0].arn
259+
target_group_arn = aws_lb_target_group.apigw_metadata.arn
260+
target_id = aws_lb.alb.arn
261261
}
262262

263263
resource "aws_lb_target_group" "apigw_db_migrate" {
@@ -279,28 +279,28 @@ resource "aws_lb_target_group" "apigw_db_migrate" {
279279
}
280280

281281
resource "aws_lb_target_group_attachment" "apigw_db_migrate" {
282-
target_group_arn = aws_lb_target_group.apigw_db_migrate[0].arn
283-
target_id = aws_lb.alb[0].arn
282+
target_group_arn = aws_lb_target_group.apigw_db_migrate.arn
283+
target_id = aws_lb.alb.arn
284284
}
285285

286286
resource "aws_lb_listener" "apigw_metadata" {
287-
load_balancer_arn = aws_lb.apigw_nlb[0].arn
287+
load_balancer_arn = aws_lb.apigw_nlb.arn
288288
port = "80"
289289
protocol = "TCP"
290290

291291
default_action {
292292
type = "forward"
293-
target_group_arn = aws_lb_target_group.apigw_metadata[0].arn
293+
target_group_arn = aws_lb_target_group.apigw_metadata.arn
294294
}
295295
}
296296

297297
resource "aws_lb_listener" "apigw_db_migrate" {
298-
load_balancer_arn = aws_lb.apigw_nlb[0].arn
298+
load_balancer_arn = aws_lb.apigw_nlb.arn
299299
port = "8082"
300300
protocol = "TCP"
301301

302302
default_action {
303303
type = "forward"
304-
target_group_arn = aws_lb_target_group.apigw_db_migrate[0].arn
304+
target_group_arn = aws_lb_target_group.apigw_db_migrate.arn
305305
}
306306
}

modules/metadata-service/lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ resource "aws_lambda_function" "db_migrate_lambda" {
126126

127127
environment {
128128
variables = {
129-
MD_LB_ADDRESS = "http://${aws_lb.this.dns_name}:8082"
129+
MD_LB_ADDRESS = "http://${aws_lb.alb.dns_name}:8082"
130130
}
131131
}
132132

modules/metadata-service/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
output "METAFLOW_SERVICE_INTERNAL_URL" {
2-
value = "http://${aws_lb.this.dns_name}/"
2+
value = "http://${aws_lb.alb.dns_name}/"
33
description = "URL for Metadata Service (Accessible in VPC)"
44
}
55

@@ -34,6 +34,6 @@ output "metadata_svc_ecs_task_role_arn" {
3434
}
3535

3636
output "network_load_balancer_dns_name" {
37-
value = aws_lb.this.dns_name
37+
value = aws_lb.alb.dns_name
3838
description = "The DNS addressable name for the Network Load Balancer that accepts requests and forwards them to our Fargate MetaData service instance(s)"
3939
}

0 commit comments

Comments
 (0)