Skip to content

Commit 86a4467

Browse files
committed
fix: Correct logic through region data source
1 parent 95fac69 commit 86a4467

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/service/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
data "aws_region" "current" {
2+
region = var.region
3+
24
count = var.create ? 1 : 0
35
}
46
data "aws_partition" "current" {
@@ -11,7 +13,7 @@ data "aws_caller_identity" "current" {
1113
locals {
1214
account_id = try(data.aws_caller_identity.current[0].account_id, "")
1315
partition = try(data.aws_partition.current[0].partition, "")
14-
region = var.region != null ? var.region : try(data.aws_region.current[0].region, "")
16+
region = try(data.aws_region.current[0].region, "")
1517
}
1618

1719
################################################################################

0 commit comments

Comments
 (0)