From 17d3f6607382374746e82ec842e2a7ceed485663 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 6 Mar 2023 18:35:07 -0800 Subject: [PATCH] Simplifying nginx vars --- infra/input-vars.tf | 2 +- infra/load-balancer.tf | 2 +- infra/nginx.tf | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/infra/input-vars.tf b/infra/input-vars.tf index 1643876..d28b40c 100644 --- a/infra/input-vars.tf +++ b/infra/input-vars.tf @@ -59,7 +59,7 @@ variable "shockrah_xyz_s3_secret_key" { sensitive = true } -variable "shockrah_xyz_nginx_port" { +variable "nginx_port" { description = "Port for shockrah.xyz" type = number default = 80 diff --git a/infra/load-balancer.tf b/infra/load-balancer.tf index 11c028d..5375e99 100644 --- a/infra/load-balancer.tf +++ b/infra/load-balancer.tf @@ -22,7 +22,7 @@ resource "aws_lb" "alpha" { ##################################################################### resource "aws_lb_target_group" "shockrah_xyz" { name = "${var.athens_prefix}-shockrah-xyz" - port = var.shockrah_xyz_nginx_port + port = var.nginx_port protocol = "HTTP" target_type = "ip" vpc_id = aws_vpc.athens_vpc.id diff --git a/infra/nginx.tf b/infra/nginx.tf index 559c6bb..de6da8d 100644 --- a/infra/nginx.tf +++ b/infra/nginx.tf @@ -19,10 +19,9 @@ resource "aws_ecs_task_definition" "beta" { memory = 512 essential = true portMappings = [ - # blog.shockrah.xyz { - containerPort = var.shockrah_xyz_nginx_port, - hostPort = var.shockrah_xyz_nginx_port + containerPort = var.nginx_port, + hostPort = var.nginx_port } ] logConfiguration = { @@ -50,7 +49,7 @@ resource "aws_ecs_service" "beta_reverse_proxy" { load_balancer { target_group_arn = aws_lb_target_group.shockrah_xyz.arn container_name = "${var.athens_prefix}-beta-container" - container_port = var.shockrah_xyz_nginx_port + container_port = var.nginx_port } network_configuration {