Skip to content

Commit

Permalink
Update main.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshitSF authored Jan 31, 2025
1 parent 2c05b5b commit 051a657
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/eks-auth/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ resource "kubernetes_config_map_v1_data" "aws_auth" {
# Convert to list, make distinct to remove duplicates, and convert to YAML as mapRoles is a YAML string.
# Replace() removes double quotes on "strings" in YAML output.
# Distinct() only applies the change once, not append every run.
mapRoles = length(local.new_role_yaml) > 0 ? replace(yamlencode(distinct(concat(yamldecode(data.kubernetes_config_map.aws_auth.data.mapRoles), yamldecode(local.new_role_yaml)))), "\"", "")
mapRoles = length(local.new_role_yaml) > 0 ? replace(yamlencode(distinct(concat(yamldecode(data.kubernetes_config_map.aws_auth.data.mapRoles), yamldecode(local.new_role_yaml)))), "\"", "") : ""
#mapUsers = replace(yamlencode(distinct(concat(yamldecode(data.kubernetes_config_map.aws_auth.data.mapUsers), yamldecode(local.new_user_yaml)))), "\"", "")
mapAccounts = length(local.new_account_yaml) > 0 ? replace(yamlencode(distinct(concat(yamldecode(coalesce(data.kubernetes_config_map.aws_auth.data.mapAccounts, "[]")), yamldecode(local.new_account_yaml)))), "\"", "") : ""
mapUsers = length(local.new_user_yaml) > 0 ? replace(yamlencode(distinct(concat(yamldecode(coalesce(data.kubernetes_config_map.aws_auth.data.mapUsers, "[]")), yamldecode(local.new_user_yaml)))), "\"", "") : ""
Expand Down

0 comments on commit 051a657

Please sign in to comment.