terraform-google-modules/terraform-google-vm

Add variable for name separator instead of hardcoded hifen

Closed this issue · 3 comments

TL;DR

I'd like to set a different separator when adding suffix to the hostname to compose the name abc-y001.

Terraform Resources

[GCP Compute Instance](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance)

Detailed design

When the variable add_hostname_suffix is true it's going to compose the name as per this line of code:
var.add_hostname_suffix ? "${local.hostname}-${format("%03d", count.index + 1)}" : local.hostname
On my use case I want abc-y001, so I'd use the name abc-y and a blank separator.

Please, let me know if you would accept such behavior or if you have any better Idea too.

Additional information

I can work in the PR but I just would like to know if you guys are interested in the behavior.

I think we could accept a PR adding this as a variable.

we can close this one, can't we?