use nulls instead of empty strings
This commit is contained in:
@@ -28,7 +28,7 @@ resource "random_id" "name" {
|
||||
|
||||
locals {
|
||||
# If name_override is specified, use that - otherwise use the name_prefix with a random string
|
||||
instance_name = length(var.name_override) == 0 ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
instance_name = var.name_override == null ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
private_network_name = "private-network-${random_id.name.hex}"
|
||||
private_ip_name = "private-ip-${random_id.name.hex}"
|
||||
}
|
||||
|
||||
@@ -55,5 +55,5 @@ variable "db_name" {
|
||||
variable "name_override" {
|
||||
description = "You may optionally override the name_prefix + random string by specifying an override"
|
||||
type = string
|
||||
default = ""
|
||||
default = null
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ resource "random_id" "name" {
|
||||
|
||||
locals {
|
||||
# If name_override is specified, use that - otherwise use the name_prefix with a random string
|
||||
instance_name = length(var.name_override) == 0 ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
instance_name = var.name_override == null ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
@@ -55,7 +55,7 @@ variable "db_name" {
|
||||
variable "name_override" {
|
||||
description = "You may optionally override the name_prefix + random string by specifying an override"
|
||||
type = string
|
||||
default = ""
|
||||
default = null
|
||||
}
|
||||
|
||||
# When configuring a public IP instance, you should only allow secure connections
|
||||
|
||||
@@ -28,7 +28,7 @@ resource "random_id" "name" {
|
||||
|
||||
locals {
|
||||
# If name_override is specified, use that - otherwise use the name_prefix with a random string
|
||||
instance_name = "${length(var.name_override) == 0 ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override}"
|
||||
instance_name = var.name_override == null ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
private_network_name = "private-network-${random_id.name.hex}"
|
||||
private_ip_name = "private-ip-${random_id.name.hex}"
|
||||
}
|
||||
|
||||
@@ -78,5 +78,5 @@ variable "db_name" {
|
||||
variable "name_override" {
|
||||
description = "You may optionally override the name_prefix + random string by specifying an override"
|
||||
type = string
|
||||
default = ""
|
||||
default = null
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ resource "random_id" "name" {
|
||||
|
||||
locals {
|
||||
# If name_override is specified, use that - otherwise use the name_prefix with a random string
|
||||
instance_name = "${length(var.name_override) == 0 ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override}"
|
||||
instance_name = var.name_override == null ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
private_network_name = "private-network-${random_id.name.hex}"
|
||||
private_ip_name = "private-ip-${random_id.name.hex}"
|
||||
}
|
||||
|
||||
@@ -55,5 +55,5 @@ variable "db_name" {
|
||||
variable "name_override" {
|
||||
description = "You may optionally override the name_prefix + random string by specifying an override"
|
||||
type = string
|
||||
default = ""
|
||||
default = null
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ resource "random_id" "name" {
|
||||
|
||||
locals {
|
||||
# If name_override is specified, use that - otherwise use the name_prefix with a random string
|
||||
instance_name = length(var.name_override) == 0 ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
instance_name = var.name_override == null ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
@@ -55,7 +55,7 @@ variable "db_name" {
|
||||
variable "name_override" {
|
||||
description = "You may optionally override the name_prefix + random string by specifying an override"
|
||||
type = string
|
||||
default = ""
|
||||
default = null
|
||||
}
|
||||
|
||||
# When configuring a public IP instance, you should only allow secure connections
|
||||
|
||||
@@ -28,7 +28,7 @@ resource "random_id" "name" {
|
||||
|
||||
locals {
|
||||
# If name_override is specified, use that - otherwise use the name_prefix with a random string
|
||||
instance_name = length(var.name_override) == 0 ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
instance_name = var.name_override == null ? format("%s-%s", var.name_prefix, random_id.name.hex) : var.name_override
|
||||
private_network_name = "private-network-${random_id.name.hex}"
|
||||
private_ip_name = "private-ip-${random_id.name.hex}"
|
||||
}
|
||||
|
||||
@@ -78,5 +78,5 @@ variable "db_name" {
|
||||
variable "name_override" {
|
||||
description = "You may optionally override the name_prefix + random string by specifying an override"
|
||||
type = string
|
||||
default = ""
|
||||
default = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user