diff --git a/terraform-modules/aws/kubernetes/pod_assumable_role/main.tf b/terraform-modules/aws/kubernetes/pod_assumable_role/main.tf index cb3d2a121..bacacb1e9 100644 --- a/terraform-modules/aws/kubernetes/pod_assumable_role/main.tf +++ b/terraform-modules/aws/kubernetes/pod_assumable_role/main.tf @@ -4,7 +4,7 @@ module "iam_assumable_role" { create_role = true role_name = var.name provider_url = replace(var.eks_cluster_oidc_issuer_url, "https://", "") - role_policy_arns = [aws_iam_policy.iam_policy.arn] + role_policy_arns = concat(var.iam_policy_arns, [aws_iam_policy.iam_policy.arn]) oidc_fully_qualified_subjects = ["system:serviceaccount:${var.k8s_namespace}:${var.name}"] tags = var.tags } diff --git a/terraform-modules/aws/kubernetes/pod_assumable_role/variables.tf b/terraform-modules/aws/kubernetes/pod_assumable_role/variables.tf index d78924cce..0e61d363d 100644 --- a/terraform-modules/aws/kubernetes/pod_assumable_role/variables.tf +++ b/terraform-modules/aws/kubernetes/pod_assumable_role/variables.tf @@ -32,3 +32,9 @@ variable "iam_policy_json" { description = "The IAM policy json" default = "{}" } + +variable "iam_policy_arns" { + type = list(string) + description = "The IAM policy readonly list" + default = [] +}