Skip to content

Commit bfce09d

Browse files
committed
chore: change from split to jsonencode
1 parent 0b1eec5 commit bfce09d

File tree

1 file changed

+9
-3
lines changed
  • modules/sapbtp/subaccounts/buildingblock

1 file changed

+9
-3
lines changed

modules/sapbtp/subaccounts/buildingblock/locals.tf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
locals {
22
quota_based_services = ["postgresql-db", "redis-cache", "hana-cloud", "auditlog-viewer"]
33

4-
raw_entitlements = var.entitlements != "" ? split(",", var.entitlements) : []
4+
raw_entitlements = var.entitlements != "" ? (
5+
can(jsondecode(var.entitlements)) ? jsondecode(var.entitlements) : split(",", var.entitlements)
6+
) : []
57

68
parsed_entitlements = [
79
for e in local.raw_entitlements :
@@ -23,7 +25,9 @@ locals {
2325
e if e.amount == null
2426
]
2527

26-
raw_subscriptions = var.subscriptions != "" ? split(",", var.subscriptions) : []
28+
raw_subscriptions = var.subscriptions != "" ? (
29+
can(jsondecode(var.subscriptions)) ? jsondecode(var.subscriptions) : split(",", var.subscriptions)
30+
) : []
2731

2832
parsed_subscriptions = [
2933
for s in local.raw_subscriptions :
@@ -35,7 +39,9 @@ locals {
3539
if trimspace(s) != ""
3640
]
3741

38-
raw_cf_services = var.cf_services != "" ? split(",", var.cf_services) : []
42+
raw_cf_services = var.cf_services != "" ? (
43+
can(jsondecode(var.cf_services)) ? jsondecode(var.cf_services) : split(",", var.cf_services)
44+
) : []
3945

4046
parsed_cf_services = [
4147
for s in local.raw_cf_services :

0 commit comments

Comments
 (0)