Skip to content

Commit 90a2160

Browse files
author
Steven Nemetz
committed
Replace _ with - in name instead of just trucated IDs
1 parent 72fa9b6 commit 90a2160

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ module "namespace-org" {
2525
locals {
2626
attr = "${lower(format("%s", join(var.delimiter, compact(var.attributes))))}"
2727
env = "${lower(format("%s", var.environment))}"
28-
name_low = "${lower(format("%s", var.name))}"
28+
name_low = "${replace(lower(format("%s", var.name)),"_","-")}"
2929
org = "${lower(format("%s", var.organization))}"
3030
id_env = "${module.namespace-env.value ? join(var.delimiter, list(local.env, local.name_low)) : local.name_low}"
3131
id_org = "${module.namespace-org.value ? join(var.delimiter, list(local.org, local.id_env)) : local.id_env}"
3232
id = "${length(local.attr) > 0 ? join(var.delimiter, list(local.id_org, local.attr)) : local.id_org}"
33-
id_20 = "${substr(replace(local.id,"_","-"),0,19 <= length(local.id) ? 19 : length(local.id))}"
34-
id_32 = "${substr(replace(local.id,"_","-"),0,31 <= length(local.id) ? 31 : length(local.id))}"
33+
id_20 = "${substr(local.id,0,19 <= length(local.id) ? 19 : length(local.id))}"
34+
id_32 = "${substr(local.id,0,31 <= length(local.id) ? 31 : length(local.id))}"
3535
org_attr_20 = "${min(18 - length(local.attr), length(local.id_org))}"
3636
id_attr_20 = "${19 <= length(local.id) ?
3737
join(var.delimiter,

0 commit comments

Comments
 (0)