From 49c72103d8f715a6b82c27303f8712d70bb1266b Mon Sep 17 00:00:00 2001 From: Andrew Hemming Date: Tue, 15 Oct 2024 09:29:45 +0000 Subject: [PATCH] Back to object --- modules/postgres-etl/extract/extract_task.tf | 2 +- modules/postgres-etl/extract/variables.tf | 14 +++++----- modules/postgres-etl/load/load_task.tf | 2 +- modules/postgres-etl/load/variables.tf | 14 +++++----- modules/postgres-etl/variables.tf | 28 +++++++++----------- 5 files changed, 26 insertions(+), 34 deletions(-) diff --git a/modules/postgres-etl/extract/extract_task.tf b/modules/postgres-etl/extract/extract_task.tf index 16bb72d3..b5776dc6 100644 --- a/modules/postgres-etl/extract/extract_task.tf +++ b/modules/postgres-etl/extract/extract_task.tf @@ -41,7 +41,7 @@ module "extract_task" { ] } } - ecs_execution_role_arn = var.ecs_extract_execution_role_arn + ecs_execution_role_arn = var.ecs_extract_execution_role.arn family_name = "${var.migrator_name}_extract" task_cpu = var.extract_task_cpu task_memory = var.extract_task_memory diff --git a/modules/postgres-etl/extract/variables.tf b/modules/postgres-etl/extract/variables.tf index 85ccf2e2..e9bc4812 100644 --- a/modules/postgres-etl/extract/variables.tf +++ b/modules/postgres-etl/extract/variables.tf @@ -23,14 +23,12 @@ variable "ecs_cluster_arn" { description = "ARN of cluster into which tasks will be deployed" } -variable "ecs_extract_execution_role_arn" { - type = string - description = "ARN of the role which is assumed by the ECS execution processes" -} - -variable "ecs_extract_execution_role_name" { - type = string - description = "Name of the role which is assumed by the ECS execution processes" +variable "ecs_extract_execution_role" { + type = object({ + arn = string + name = string + }) + description = "Details of the role which is assumed by the ECS execution processes" } variable "efs_subnet_ids" { diff --git a/modules/postgres-etl/load/load_task.tf b/modules/postgres-etl/load/load_task.tf index 65dccae3..768e61e6 100644 --- a/modules/postgres-etl/load/load_task.tf +++ b/modules/postgres-etl/load/load_task.tf @@ -34,7 +34,7 @@ module "load_task" { ] } } - ecs_execution_role_arn = var.ecs_load_execution_role_arn + ecs_execution_role_arn = var.ecs_load_execution_role.arn family_name = "${var.migrator_name}_load" task_cpu = var.load_task_cpu task_memory = var.load_task_memory diff --git a/modules/postgres-etl/load/variables.tf b/modules/postgres-etl/load/variables.tf index 4daf07d0..35b3bb56 100644 --- a/modules/postgres-etl/load/variables.tf +++ b/modules/postgres-etl/load/variables.tf @@ -23,14 +23,12 @@ variable "ecs_cluster_arn" { description = "ARN of cluster into which tasks will be deployed" } -variable "ecs_load_execution_role_arn" { - type = string - description = "ARN of the role which is assumed by the ECS execution processes" -} - -variable "ecs_load_execution_role_name" { - type = string - description = "Name of the role which is assumed by the ECS execution processes" +variable "ecs_load_execution_role" { + type = object({ + arn = string + name = string + }) + description = "Details of the role which is assumed by the ECS execution processes" } variable "efs_subnet_ids" { diff --git a/modules/postgres-etl/variables.tf b/modules/postgres-etl/variables.tf index 9868641e..defc2733 100644 --- a/modules/postgres-etl/variables.tf +++ b/modules/postgres-etl/variables.tf @@ -23,24 +23,20 @@ variable "ecs_cluster_arn" { description = "ARN of cluster into which tasks will be deployed" } -variable "ecs_extract_execution_role_arn" { - type = string - description = "ARN of the role which is assumed by the ECS execution processes" -} - -variable "ecs_load_execution_role_arn" { - type = string - description = "ARN of the role which is assumed by the ECS execution processes" -} - -variable "ecs_extract_execution_role_name" { - type = string - description = "Name of the role which is assumed by the ECS execution processes" +variable "ecs_extract_execution_role" { + type = object({ + arn = string + name = string + }) + description = "Details of the role which is assumed by the ECS execution processes" } -variable "ecs_load_execution_role_name" { - type = string - description = "Name of the role which is assumed by the ECS execution processes" +variable "ecs_load_execution_role" { + type = object({ + arn = string + name = string + }) + description = "Details of the role which is assumed by the ECS execution processes" } variable "efs_subnet_ids" {