Skip to content

Commit 08f4385

Browse files
committed
bug: fix issue with aws account and region vars when set
1 parent 94d7156 commit 08f4385

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ locals {
22
enabled = coalesce(var.enabled, module.this.enabled, true)
33
name = coalesce(var.name, module.this.name, "teleport-cluster-${random_string.teleport_cluster_random_suffix.result}")
44

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

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

0 commit comments

Comments
 (0)