From 8e7bd32d910f2e9f17fb563ef76e80a04ebc272c Mon Sep 17 00:00:00 2001 From: vaibhavcompanieshouse Date: Fri, 22 Nov 2024 20:06:55 +0000 Subject: [PATCH] added name changes --- .../module-albs/file-transfer-secure.tf | 4 +-- .../module-albs/file-transfer.tf | 34 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/groups/infrastructure/module-albs/file-transfer-secure.tf b/groups/infrastructure/module-albs/file-transfer-secure.tf index bbd1a3a..4ddf799 100644 --- a/groups/infrastructure/module-albs/file-transfer-secure.tf +++ b/groups/infrastructure/module-albs/file-transfer-secure.tf @@ -1,7 +1,7 @@ resource "aws_lb" "secure_file_transfer_alb" { count = "${var.secure_file_transfer_create_alb == 1 ? 1 : 0}" - name = "${var.environment}-secure-filetransfer" + name = "${var.environment}-secure-file-transfer" subnets = var.subnet_ids security_groups = ["${aws_security_group.secure-file-transfer_sg.id}"] internal = "${var.secure_file_transfer_internet_facing == 0 ? true : false}" @@ -10,7 +10,7 @@ resource "aws_lb" "secure_file_transfer_alb" { tags ={ Environment = "${var.environment}" - Name = "${var.environment}-secure-filetransfer" + Name = "${var.environment}-secure-file-transfer" ALB = "true" } } diff --git a/groups/infrastructure/module-albs/file-transfer.tf b/groups/infrastructure/module-albs/file-transfer.tf index ac7a4f5..faabafe 100644 --- a/groups/infrastructure/module-albs/file-transfer.tf +++ b/groups/infrastructure/module-albs/file-transfer.tf @@ -2,10 +2,10 @@ #------------------------------------------------------------------------------ # ALB Resources #------------------------------------------------------------------------------ -resource "aws_lb" "filetransfer_alb" { +resource "aws_lb" "file_transfer_alb" { count = "${var.file_transfer_create_alb == 1 ? 1 : 0}" - name = "${var.environment}-filetransfer" + name = "${var.environment}-file-transfer" subnets = var.subnet_ids security_groups = ["${aws_security_group.file-transfer-sg.id}"] internal = true @@ -14,28 +14,28 @@ resource "aws_lb" "filetransfer_alb" { tags = { Environment = "${var.environment}" - Name = "${var.environment}-filetransfer" + Name = "${var.environment}-file-transfer" ALB = "true" } } -resource "aws_lb_listener" "filetransfer_80" { +resource "aws_lb_listener" "file_transfer_80" { count = "${var.file_transfer_create_alb == 1 ? 1 : 0}" - load_balancer_arn = "${aws_lb.filetransfer_alb[0].arn}" + load_balancer_arn = "${aws_lb.file_transfer_alb[0].arn}" port = "80" protocol = "HTTP" default_action { type = "forward" - target_group_arn = "${aws_lb_target_group.filetransfer_18020[0].arn}" + target_group_arn = "${aws_lb_target_group.file_transfer_18020[0].arn}" } } -resource "aws_lb_listener" "filetransfer_443" { +resource "aws_lb_listener" "file_transfer_443" { count = "${var.file_transfer_create_alb == 1 ? 1 : 0}" - load_balancer_arn = "${aws_lb.filetransfer_alb[0].arn}" + load_balancer_arn = "${aws_lb.file_transfer_alb[0].arn}" port = "443" protocol = "HTTPS" ssl_policy = "ELBSecurityPolicy-2016-08" @@ -43,14 +43,14 @@ resource "aws_lb_listener" "filetransfer_443" { default_action { type = "forward" - target_group_arn = "${aws_lb_target_group.filetransfer_18020[0].arn}" + target_group_arn = "${aws_lb_target_group.file_transfer_18020[0].arn}" } } -resource "aws_lb_target_group" "filetransfer_18020" { +resource "aws_lb_target_group" "file_transfer_18020" { count = "${var.file_transfer_create_alb == 1 ? 1 : 0}" - name = "${var.environment}-filetransfer-18020" + name = "${var.environment}-file-transfer-18020" port = 18020 protocol = "HTTP" vpc_id = "${var.vpc_id}" @@ -67,24 +67,24 @@ resource "aws_lb_target_group" "filetransfer_18020" { } } -resource "aws_lb_target_group_attachment" "filetransfer_18020" { +resource "aws_lb_target_group_attachment" "file_transfer_18020" { count = "${var.file_transfer_create_alb == 1 ? length(var.gateway_ids_list) : 0}" - target_group_arn = "${aws_lb_target_group.filetransfer_18020[0].arn}" + target_group_arn = "${aws_lb_target_group.file_transfer_18020[0].arn}" target_id = "${element(var.gateway_ids_list, 0)}" port = 18020 } -resource "aws_route53_record" "filetransfer_alb_r53_record" { +resource "aws_route53_record" "file_transfer_alb_r53_record" { count = "${var.zone_id == "" ? 0 : 1}" # zone_id defaults to empty string giving count = 0 i.e. not route 53 record zone_id = "${var.zone_id}" - name = "filetransfer${var.external_top_level_domain}" + name = "file-transfer${var.external_top_level_domain}" type = "A" allow_overwrite = true alias { - name = "${aws_lb.filetransfer_alb[0].dns_name}" - zone_id = "${aws_lb.filetransfer_alb[0].zone_id}" + name = "${aws_lb.file_transfer_alb[0].dns_name}" + zone_id = "${aws_lb.file_transfer_alb[0].zone_id}" evaluate_target_health = false } } \ No newline at end of file