diff --git a/modules/postgres-etl/extract/extract_iam.tf b/modules/postgres-etl/extract/extract_iam.tf index 22e3fb90..a1a81d54 100644 --- a/modules/postgres-etl/extract/extract_iam.tf +++ b/modules/postgres-etl/extract/extract_iam.tf @@ -189,8 +189,8 @@ data "aws_iam_policy_document" "rds_to_s3_sfn" { } } -resource "aws_iam_policy" "k8s_monitor_sfn" { - name = "k8s-monitor-sfn" +resource "aws_iam_policy" "eks_paas_jenkins_monitor_sfn" { + name = "${var.migrator_name}-eks-paas-jenkins-monitor-sfn" description = "Allows the k8s-postgres-etl role to monitor the Postgres ETL Step Function" policy = jsonencode({ Version = "2012-10-17", @@ -283,7 +283,7 @@ resource "aws_iam_role_policy" "s3__postgres_etl_extract" { policy = data.aws_iam_policy_document.s3.json } -resource "aws_iam_role_policy_attachment" "k8s_etl_monitor_sfn" { - role = "k8s-${var.migrator_name}" - policy_arn = aws_iam_policy.k8s_monitor_sfn.arn +resource "aws_iam_role_policy_attachment" "eks_paas_jenkins_monitor_sfn" { + role = "${var.migrator_name}-eks-paas-jenkins" + policy_arn = aws_iam_policy.eks_paas_jenkins_monitor_sfn.arn } diff --git a/modules/postgres-etl/load/load_iam.tf b/modules/postgres-etl/load/load_iam.tf index aef5fa9a..8afb9549 100644 --- a/modules/postgres-etl/load/load_iam.tf +++ b/modules/postgres-etl/load/load_iam.tf @@ -211,8 +211,8 @@ data "aws_iam_policy_document" "s3_to_rds_sfn" { } } -resource "aws_iam_policy" "k8s_trigger_sfn" { - name = "k8s-trigger-sfn" +resource "aws_iam_policy" "eks_paas_jenkins_trigger_sfn" { + name = "${var.migrator_name}-eks-paas-jenkins-trigger-sfn" description = "Allows the k8s-postgres-etl role to trigger the Postgres ETL Step Function" policy = jsonencode({ Version = "2012-10-17", @@ -283,7 +283,7 @@ resource "aws_iam_role_policy" "s3__postgres_etl_load" { policy = data.aws_iam_policy_document.s3.json } -resource "aws_iam_role_policy_attachment" "k8s_etl_trigger_sfn" { - role = "k8s-${var.migrator_name}" - policy_arn = aws_iam_policy.k8s_trigger_sfn.arn +resource "aws_iam_role_policy_attachment" "eks_paas_jenkins_trigger_sfn" { + role = "${var.migrator_name}-eks-paas-jenkins" + policy_arn = aws_iam_policy.eks_paas_jenkins_trigger_sfn.arn } diff --git a/modules/postgres-etl/main.tf b/modules/postgres-etl/main.tf index 26e69faf..469223b1 100644 --- a/modules/postgres-etl/main.tf +++ b/modules/postgres-etl/main.tf @@ -45,8 +45,8 @@ module "load" { } # Shared resources -resource "aws_iam_role" "k8s_postgres_etl" { - name = "k8s-${var.migrator_name}" +resource "aws_iam_role" "eks_paas_jenkins" { + name = "${var.migrator_name}-eks-paas-jenkins" assume_role_policy = jsonencode({ Version = "2012-10-17", Statement = [