Skip to content

Instantly share code, notes, and snippets.

@yohanb
Last active October 24, 2019 17:28
Show Gist options
  • Save yohanb/680b77d3becd3a089454affddbc997a1 to your computer and use it in GitHub Desktop.
Save yohanb/680b77d3becd3a089454affddbc997a1 to your computer and use it in GitHub Desktop.
Simple example of resource group naming.
locals {
org = "acme"
prj = "rockets"
env = "staging"
suffix = "01234"
}
resource "azurerm_resource_group" "example" {
name = # Value on next line for readability
regex("^[-\\w\\._\\(\\)]+$",substr("rg-${local.org}-${local.prj}-${local.env}-main-${local.suffix}", 90))
location = "eastus"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment