diff --git a/modules/postgres-etl/extract/etl_policies.tf b/modules/postgres-etl/extract/etl_policies.tf index 5c88cbea..a05cc032 100644 --- a/modules/postgres-etl/extract/etl_policies.tf +++ b/modules/postgres-etl/extract/etl_policies.tf @@ -50,7 +50,7 @@ data "aws_iam_policy_document" "ecs_exec_policy" { } } -data "aws_iam_policy_document" "etl_policy" { +data "aws_iam_policy_document" "ecr_policy" { version = "2012-10-17" statement { @@ -201,3 +201,8 @@ resource "aws_iam_role_policy" "logging" { role = var.ecs_extract_execution_role.name policy = data.aws_iam_policy_document.logging_policy.json } + +resource "aws_iam_role_policy" "ecr" { + role = var.ecs_extract_execution_role.name + policy = data.aws_iam_policy_document.ecr_policy.json +} diff --git a/modules/postgres-etl/load/etl_policies.tf b/modules/postgres-etl/load/etl_policies.tf index 63e6a507..73dcaefb 100644 --- a/modules/postgres-etl/load/etl_policies.tf +++ b/modules/postgres-etl/load/etl_policies.tf @@ -50,7 +50,7 @@ data "aws_iam_policy_document" "ecs_exec_policy" { } } -data "aws_iam_policy_document" "etl_policy" { +data "aws_iam_policy_document" "ecr_policy" { version = "2012-10-17" statement { @@ -140,3 +140,8 @@ resource "aws_iam_role_policy" "logging" { role = var.ecs_load_execution_role.name policy = data.aws_iam_policy_document.logging_policy.json } + +resource "aws_iam_role_policy" "ecr" { + role = var.ecs_load_execution_role.name + policy = data.aws_iam_policy_document.ecr_policy.json +}