Skip to content

Commit 5706e7d

Browse files
authored
Merge pull request #19 from truefoundry/cap-iam-prefix-length
Cap iam role prefix length
2 parents 194ad56 + 6b75ad6 commit 5706e7d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ resource "aws_iam_role" "truefoundry_platform_feature_iam_role" {
193193
count = var.platform_user_enabled ? 0 : 1
194194
name = var.platform_role_enable_override ? var.platform_role_override_name : null
195195
description = "IAM role for TrueFoundry platform to access S3 bucket, SSM, ECR and EKS"
196-
name_prefix = var.platform_role_enable_override ? null : "${local.truefoundry_unique_name}-iam-role-"
196+
name_prefix = var.platform_role_enable_override ? null : local.iam_role_name_prefix
197197
force_detach_policies = true
198198

199199
assume_role_policy = jsonencode({

locals.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ locals {
1717
]
1818
truefoundry_platform_policy_arns = [for arn in local.policy_arns : tostring(arn) if arn != null]
1919

20-
oidc_provider_url = replace(data.aws_eks_cluster.cluster.identity[0].oidc[0].issuer, "https://", "")
20+
oidc_provider_url = replace(data.aws_eks_cluster.cluster.identity[0].oidc[0].issuer, "https://", "")
21+
iam_role_name_prefix = trimsuffix(substr("${local.truefoundry_unique_name}-iam-role-", 0, 37), "-")
2122
}

0 commit comments

Comments
 (0)