TFNFR13 - Default Values with coalesce/try
The following example shows how "${var.subnet_name}-nsg"
SHOULD be used when var.new_network_security_group_name
is null
or ""
Good examples:
coalesce(var.new_network_security_group_name, "${var.subnet_name}-nsg")
try(coalesce(var.new_network_security_group.name, "${var.subnet_name}-nsg"), "${var.subnet_name}-nsg")
Bad examples:
var.new_network_security_group_name == null ? "${var.subnet_name}-nsg" : var.new_network_security_group_name)