Skip to content

Commit

Permalink
Tribunals: code cleanup (#7422)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-k1998 authored Aug 9, 2024
1 parent b48543d commit fdd9038
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 149 deletions.
24 changes: 2 additions & 22 deletions terraform/environments/tribunals/application_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,11 @@
"support_team": "DTS Legacy Apps Support Team",
"support_email": "[email protected]",
"server_port_1": "80",
"lb_listener_protocol_1": "HTTP",
"server_port_2": "443",
"lb_listener_protocol_2": "HTTPS",
"server_port_3": "22",
"lb_listener_protocol_3": "TCP",
"ami_image_id": "ami-0d20b6fc5007adcb3",
"task_definition_volume": "tribunals",
"server_port": 8080,
"app_count": 1,
"appscaling_min_capacity": 1,
"appscaling_max_capacity": 2,
"ec2_scaling_cpu_threshold": 75,
"ec2_scaling_mem_threshold": 61,
"ecs_scaling_cpu_threshold": 80,
"ecs_scaling_mem_threshold": 80
},
Expand All @@ -45,12 +37,6 @@
"support_team": "DTS Legacy Apps Support Team",
"support_email": "[email protected]",
"server_port_1": "80",
"lb_listener_protocol_1": "HTTP",
"server_port_2": "443",
"lb_listener_protocol_2": "HTTPS",
"server_port_3": "22",
"lb_listener_protocol_3": "TCP",
"ami_image_id": "ami-0d20b6fc5007adcb3",
"task_definition_volume": "tribunals",
"server_port": 8080,
"app_count": 1,
Expand All @@ -72,16 +58,10 @@
"support_team": "DTS Legacy Apps Support Team",
"support_email": "[email protected]",
"server_port_1": "80",
"lb_listener_protocol_1": "HTTP",
"server_port_2": "443",
"lb_listener_protocol_2": "HTTPS",
"server_port_3": "22",
"lb_listener_protocol_3": "TCP",
"ami_image_id": "ami-0d233dc36193b1c63",
"task_definition_volume": "tribunals",
"server_port": 8080,
"app_count": 2,
"appscaling_min_capacity": 2,
"app_count": 1,
"appscaling_min_capacity": 1,
"appscaling_max_capacity": 6,
"ecs_scaling_cpu_threshold": 80,
"ecs_scaling_mem_threshold": 80
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/tribunals/load_balancer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ resource "aws_lb_listener" "tribunals_lb" {
load_balancer_arn = aws_lb.tribunals_lb.arn
port = 443
protocol = "HTTPS"
ssl_policy = local.application_data.accounts[local.environment].lb_listener_protocol_2 == "HTTP" ? "" : "ELBSecurityPolicy-TLS13-1-2-2021-06"
ssl_policy = "ELBSecurityPolicy-TLS13-1-2-2021-06"

default_action {
type = "fixed-response"
Expand Down
51 changes: 8 additions & 43 deletions terraform/environments/tribunals/main.tf

Large diffs are not rendered by default.

This file was deleted.

Empty file.

This file was deleted.

16 changes: 0 additions & 16 deletions terraform/environments/tribunals/modules/tribunal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,3 @@ module "app_ecs_task" {
lb_tg_arn = var.target_group_arns["${local.module_name}"]
sftp_lb_tg_arn = ""
}

####################### Load Balancer #########################################

module "ecs_loadbalancer" {
source = "../ecs_loadbalancer"
app_name = local.app
tags_common = var.tags
vpc_shared_id = var.vpc_shared_id
application_data = var.application_data
subnets_shared_public_ids = var.subnets_shared_public_ids
aws_acm_certificate_external = var.aws_acm_certificate_external
is_ftp_app = var.is_ftp_app
waf_arn = var.waf_arn
target_group_attachment_port = var.target_group_attachment_port
app_load_balancer = var.app_load_balancer
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ variable "app_source_db_user" {
variable "app_source_db_password" {
}

variable "app_load_balancer" {
}

variable "environment" {
}

Expand Down Expand Up @@ -104,9 +101,6 @@ variable "is_ftp_app" {
description = "Determines if it is an ftp app or not"
}

variable "waf_arn" {
}

variable "target_group_attachment_port" {
description = "The port of the target group"
}
Expand Down
16 changes: 0 additions & 16 deletions terraform/environments/tribunals/modules/tribunal_ftp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,3 @@ module "app_ecs_task" {
lb_tg_arn = var.target_group_arns["${local.module_name}"]
sftp_lb_tg_arn = var.target_group_arns_sftp["${local.module_name}"]
}

####################### Load Balancer #########################################

module "ecs_loadbalancer" {
source = "../ecs_loadbalancer"
app_name = local.app
tags_common = var.tags
vpc_shared_id = var.vpc_shared_id
application_data = var.application_data
subnets_shared_public_ids = var.subnets_shared_public_ids
aws_acm_certificate_external = var.aws_acm_certificate_external
is_ftp_app = var.is_ftp_app
waf_arn = var.waf_arn
target_group_attachment_port = var.target_group_attachment_port
app_load_balancer = var.app_load_balancer
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ variable "is_ftp_app" {
description = "Determines if it is an ftp app or not"
}

variable "waf_arn" {
}

variable "target_group_attachment_port" {
description = "The port of the target group"
}
Expand All @@ -76,9 +73,6 @@ variable "target_group_attachment_port_sftp" {
description = "The port of the target group for sftp"
}

variable "app_load_balancer" {
}

variable "target_group_arns" {
description = "Map of target group ARNs"
type = map(string)
Expand Down
5 changes: 5 additions & 0 deletions terraform/environments/tribunals/waf.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,8 @@ resource "aws_wafv2_web_acl" "tribunals_web_acl" {
}
}
}

resource "aws_wafv2_web_acl_association" "web_acl_association_my_lb" {
resource_arn = aws_lb.tribunals_lb.arn
web_acl_arn = aws_wafv2_web_acl.tribunals_web_acl.arn
}

0 comments on commit fdd9038

Please sign in to comment.