Skip to content

Commit

Permalink
bug: fix issue with aws account and region vars when set
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Aug 3, 2023
1 parent 94d7156 commit 08f4385
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ locals {
enabled = coalesce(var.enabled, module.this.enabled, true)
name = coalesce(var.name, module.this.name, "teleport-cluster-${random_string.teleport_cluster_random_suffix.result}")

aws_account_id = try(coalesce(var.aws_account_id, data.aws_caller_identity.current[0].account_id), "")
aws_region_name = try(coalesce(var.aws_region_name, data.aws_region.current[0].name), "")
aws_account_id = var.aws_account_id != "" ? var.aws_account_id : try(data.aws_caller_identity.current[0].account_id, "")
aws_region_name = var.aws_region_name != "" ? var.aws_region_name : try(data.aws_region.current[0].name, "")
aws_kv_namespace = trim(coalesce(var.aws_kv_namespace, "teleport-cluster/${module.teleport_cluster_label.id}"), "/")

teleport_cluster_name = join("-", [module.teleport_cluster_label.name, module.teleport_cluster_label.stage, module.teleport_cluster_label.environment])
Expand Down

0 comments on commit 08f4385

Please sign in to comment.