From 18ef424a10ca2a6021a55244555e1b50df101f5b Mon Sep 17 00:00:00 2001 From: Lucas Li <35748253+yzlucas@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:01:08 -0700 Subject: [PATCH] Terraform 6 (#119) * changes * addding wfprev_db_subnet --- terraform/ecs.tf | 4 ++-- terraform/rds.tf | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/terraform/ecs.tf b/terraform/ecs.tf index 6c64f7395..38ef55a4e 100644 --- a/terraform/ecs.tf +++ b/terraform/ecs.tf @@ -126,8 +126,8 @@ resource "aws_ecs_task_definition" "wfprev_server" { resource "aws_ecs_task_definition" "wfprev_client" { family = "wfprev-client-task-${var.TARGET_ENV}" - # execution_role_arn = aws_iam_role.wfprev_ecs_task_execution_role.arn - # task_role_arn = aws_iam_role.wfprev_app_container_role.arn + execution_role_arn = aws_iam_role.wfprev_ecs_task_execution_role.arn + task_role_arn = aws_iam_role.wfprev_app_container_role.arn network_mode = "awsvpc" requires_compatibilities = ["FARGATE"] cpu = var.WFPREV_CLIENT_CPU_UNITS diff --git a/terraform/rds.tf b/terraform/rds.tf index 424add9c8..9c1e0b58e 100644 --- a/terraform/rds.tf +++ b/terraform/rds.tf @@ -18,6 +18,7 @@ resource "aws_db_instance" "wfprev_pgsqlDB" { allocated_storage = var.DB_SIZE username = var.WFPREV_USERNAME password = var.DB_PASS + db_subnet_group_name = aws_db_subnet_group.wfprev_db_subnet.name publicly_accessible = false skip_final_snapshot = true storage_encrypted = true @@ -29,6 +30,11 @@ resource "aws_db_instance" "wfprev_pgsqlDB" { } } +resource "aws_db_subnet_group" "wfprev_db_subnet" { + name = "main" + subnet_ids = module.network.aws_subnet_ids.data.ids +} + /* resource "aws_db_instance" "wfone_pgsqlDB" { identifier = "wfone${var.target_env}"