diff --git a/modules/postgres-etl/extract/extract_iam.tf b/modules/postgres-etl/extract/extract_iam.tf index 0dfbabdb..314ada3f 100644 --- a/modules/postgres-etl/extract/extract_iam.tf +++ b/modules/postgres-etl/extract/extract_iam.tf @@ -13,18 +13,18 @@ data "aws_iam_policy_document" "postgres_etl" { resource "aws_iam_role_policy" "ecs_execution_role__postgres_etl_extract" { name = "pg-etl-policy-extract" - role = var.ecs_extract_execution_role.name + role = module.extract_task.task_role_name policy = data.aws_iam_policy_document.postgres_etl.json } resource "aws_iam_role_policy" "bucket_access__postgres_etl_extract" { name = "bucket_access_extract" - role = var.ecs_extract_execution_role.name + role = module.extract_task.task_role_name policy = data.aws_iam_policy_document.bucket_access.json } resource "aws_iam_role_policy" "ecs_exec_policy__postgres_etl_extract" { name = "ecs_exec_policy_extract" - role = var.ecs_extract_execution_role.name + role = module.extract_task.task_role_name policy = data.aws_iam_policy_document.ecs_exec_policy.json } diff --git a/modules/postgres-etl/load/load_iam.tf b/modules/postgres-etl/load/load_iam.tf index 2b98ac3a..7a5e2867 100644 --- a/modules/postgres-etl/load/load_iam.tf +++ b/modules/postgres-etl/load/load_iam.tf @@ -13,18 +13,18 @@ data "aws_iam_policy_document" "postgres_etl" { resource "aws_iam_role_policy" "ecs_execution_role__postgres_etl_load" { name = "pg-etl-policy-load" - role = var.ecs_load_execution_role.name + role = module.load_task.task_role_name policy = data.aws_iam_policy_document.postgres_etl.json } resource "aws_iam_role_policy" "bucket_access__postgres_etl_load" { name = "bucket_access_load" - role = var.ecs_load_execution_role.name + role = module.load_task.task_role_name policy = data.aws_iam_policy_document.bucket_access.json } resource "aws_iam_role_policy" "ecs_exec_policy__postgres_etl_load" { name = "ecs_exec_policy_load" - role = var.ecs_load_execution_role.name + role = module.load_task.task_role_name policy = data.aws_iam_policy_document.ecs_exec_policy.json }