From 6462f94efe8871ab93412353c5d173c2dbeac137 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 476abc8420..334b060ad4 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 0bf2edd180..c8b663e80e 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 983c92a80c..eaa0c398c8 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" {