From 06a3469d203fc4344d5f94564762432b5cfd2043 Mon Sep 17 00:00:00 2001 From: Dewen Kong Date: Thu, 17 Mar 2022 08:09:09 -0400 Subject: [PATCH] fix: Sub-modules output the correct eks worker iam arn when workers utilize custom iam role (#1912) --- modules/eks-managed-node-group/outputs.tf | 2 +- modules/fargate-profile/outputs.tf | 2 +- modules/self-managed-node-group/outputs.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/eks-managed-node-group/outputs.tf b/modules/eks-managed-node-group/outputs.tf index 476abc8..334b060 100644 --- a/modules/eks-managed-node-group/outputs.tf +++ b/modules/eks-managed-node-group/outputs.tf @@ -66,7 +66,7 @@ output "iam_role_name" { output "iam_role_arn" { description = "The Amazon Resource Name (ARN) specifying the IAM role" - value = try(aws_iam_role.this[0].arn, "") + value = try(aws_iam_role.this[0].arn, var.iam_role_arn) } output "iam_role_unique_id" { diff --git a/modules/fargate-profile/outputs.tf b/modules/fargate-profile/outputs.tf index 0bf2edd..c8b663e 100644 --- a/modules/fargate-profile/outputs.tf +++ b/modules/fargate-profile/outputs.tf @@ -9,7 +9,7 @@ output "iam_role_name" { output "iam_role_arn" { description = "The Amazon Resource Name (ARN) specifying the IAM role" - value = try(aws_iam_role.this[0].arn, "") + value = try(aws_iam_role.this[0].arn, var.iam_role_arn) } output "iam_role_unique_id" { diff --git a/modules/self-managed-node-group/outputs.tf b/modules/self-managed-node-group/outputs.tf index 983c92a..eaa0c39 100644 --- a/modules/self-managed-node-group/outputs.tf +++ b/modules/self-managed-node-group/outputs.tf @@ -124,7 +124,7 @@ output "iam_role_unique_id" { output "iam_instance_profile_arn" { description = "ARN assigned by AWS to the instance profile" - value = try(aws_iam_instance_profile.this[0].arn, "") + value = try(aws_iam_instance_profile.this[0].arn, var.iam_instance_profile_arn) } output "iam_instance_profile_id" {