diff --git a/bin/deploy.sh b/bin/deploy.sh index f29ce1e4..3577d598 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -239,7 +239,7 @@ case ${SPF_DIR} in iac*) KEY=$(echo $LINE | cut -d"=" -f1) BACK=${LINE/$KEY=/} FRONT=$(echo ${KEY/SPF_TFVAR_/} | tr "[:upper:]" "[:lower:]") - OPTIONS=" ${OPTIONS} -var spf_${FRONT}=${BACK}" + if [ -n "${BACK}" ]; then OPTIONS=" ${OPTIONS} -var spf_${FRONT}=${BACK}"; fi done <<< "$SPF_TFVARS" echo "[EXEC] cd ${WORKDIR}/${SPF_DIR}/" diff --git a/iac/cicd/service_catalog_app_registry/provider.tf b/iac/cicd/service_catalog_app_registry/provider.tf index a9acc70c..6edae6bd 100644 --- a/iac/cicd/service_catalog_app_registry/provider.tf +++ b/iac/cicd/service_catalog_app_registry/provider.tf @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MIT-0 provider "aws" { - allowed_account_ids = try(split(",", var.spf_account), null) + allowed_account_ids = try(trimspace(var.spf_account), "") != "" ? split(",", var.spf_account) : null skip_region_validation = true default_tags { diff --git a/iac/global.tf b/iac/global.tf index fd6afe4d..9ea20fca 100644 --- a/iac/global.tf +++ b/iac/global.tf @@ -6,7 +6,7 @@ data "aws_partition" "this" {} data "aws_caller_identity" "this" {} provider "aws" { - allowed_account_ids = try(split(",", var.spf_account), null) + allowed_account_ids = try(trimspace(var.spf_account), "") != "" ? split(",", var.spf_account) : null skip_region_validation = true default_tags { @@ -15,7 +15,7 @@ provider "aws" { environment = "default" contact = "github.com/eistrati" globalId = var.spf_gid - awsApplication = try(var.spf_app_arn, null) + awsApplication = try(trimspace(var.spf_app_arn), "") != "" ? var.spf_app_arn : null } } }