Error: "name" ("-dmz-to-app") doesn't match regexp "^(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)$"
on network.tf line 32, in resource "google_compute_firewall" "fw1":
32: name = "${var.deployment_label}-dmz-to-app"
So how does one now build a name using variables please ?
The syntax for name you showed here looks correct to me. It seems like Terraform successfully parsed and evaluated it, but that var.deployment_label was an empty string for some reason. Perhaps the root cause is elsewhere in your configuration, in the definition of the value for that variable.
This is unrelated to your question but I wanted to point it out because you’ll probably see an error about this after you figure out what’s going on with name:
Your source_ranges argument is currently set to literally the string "var.subnetwork-dmz-range", rather than a reference to that variable. To refer to the variable, remove the quotes like this: