Skip to content

Commit

Permalink
added name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavcompanieshouse committed Nov 22, 2024
1 parent 8103af9 commit 8e7bd32
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions groups/infrastructure/module-albs/file-transfer-secure.tf
Original file line number Diff line number Diff line change
@@ -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}"
Expand All @@ -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"
}
}
Expand Down
34 changes: 17 additions & 17 deletions groups/infrastructure/module-albs/file-transfer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,43 +14,43 @@ 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"
certificate_arn = "${var.ssl_certificate_id}"

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}"
Expand All @@ -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
}
}

0 comments on commit 8e7bd32

Please sign in to comment.