diff --git a/examples/mysql-private-ip/main.tf b/examples/mysql-private-ip/main.tf index 8f53c58..6d16b92 100644 --- a/examples/mysql-private-ip/main.tf +++ b/examples/mysql-private-ip/main.tf @@ -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}" } diff --git a/examples/mysql-private-ip/variables.tf b/examples/mysql-private-ip/variables.tf index f2dae1d..0369f8a 100644 --- a/examples/mysql-private-ip/variables.tf +++ b/examples/mysql-private-ip/variables.tf @@ -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 } diff --git a/examples/mysql-public-ip/main.tf b/examples/mysql-public-ip/main.tf index 0bf3c6b..53dba1b 100644 --- a/examples/mysql-public-ip/main.tf +++ b/examples/mysql-public-ip/main.tf @@ -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 } # ------------------------------------------------------------------------------ diff --git a/examples/mysql-public-ip/variables.tf b/examples/mysql-public-ip/variables.tf index e74462a..4dda1b2 100644 --- a/examples/mysql-public-ip/variables.tf +++ b/examples/mysql-public-ip/variables.tf @@ -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 diff --git a/examples/mysql-replicas/main.tf b/examples/mysql-replicas/main.tf index ad257a3..6be160f 100644 --- a/examples/mysql-replicas/main.tf +++ b/examples/mysql-replicas/main.tf @@ -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}" } diff --git a/examples/mysql-replicas/variables.tf b/examples/mysql-replicas/variables.tf index f29e1a9..53a28f4 100644 --- a/examples/mysql-replicas/variables.tf +++ b/examples/mysql-replicas/variables.tf @@ -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 } diff --git a/examples/postgres-private-ip/main.tf b/examples/postgres-private-ip/main.tf index a84d4bf..3e71fc6 100644 --- a/examples/postgres-private-ip/main.tf +++ b/examples/postgres-private-ip/main.tf @@ -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}" } diff --git a/examples/postgres-private-ip/variables.tf b/examples/postgres-private-ip/variables.tf index c2b31e2..125f991 100644 --- a/examples/postgres-private-ip/variables.tf +++ b/examples/postgres-private-ip/variables.tf @@ -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 } diff --git a/examples/postgres-public-ip/main.tf b/examples/postgres-public-ip/main.tf index 105dd87..b37a6f0 100644 --- a/examples/postgres-public-ip/main.tf +++ b/examples/postgres-public-ip/main.tf @@ -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 } # ------------------------------------------------------------------------------ diff --git a/examples/postgres-public-ip/variables.tf b/examples/postgres-public-ip/variables.tf index 910c2d7..1c4fb22 100644 --- a/examples/postgres-public-ip/variables.tf +++ b/examples/postgres-public-ip/variables.tf @@ -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 diff --git a/examples/postgres-replicas/main.tf b/examples/postgres-replicas/main.tf index c3ed815..bb8642b 100644 --- a/examples/postgres-replicas/main.tf +++ b/examples/postgres-replicas/main.tf @@ -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}" } diff --git a/examples/postgres-replicas/variables.tf b/examples/postgres-replicas/variables.tf index 31aba8d..3b39514 100644 --- a/examples/postgres-replicas/variables.tf +++ b/examples/postgres-replicas/variables.tf @@ -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 }