Skip to content

Instantly share code, notes, and snippets.

@yohanb
Last active October 29, 2019 18:36
Show Gist options
  • Save yohanb/d21e825f385dcd238303e08bd38dd56b to your computer and use it in GitHub Desktop.
Save yohanb/d21e825f385dcd238303e08bd38dd56b to your computer and use it in GitHub Desktop.
locals {
org = "acme"
prj = "rockets"
env = "staging"
location = "eastus"
}
resource "random_string" "suffix" {
length = 13
upper = false
special = false
keepers = {
location = local.location
}
}
module "resource_group_name" {
source = "gsoft-inc/naming/azurerm//modules/general/resource_group"
name = "main"
prefixes = ["rg", local.org, local.prj, local.env]
suffixes = [random_string.suffix.result]
}
resource "azurerm_resource_group" "example" {
name = module.resource_group_name.result
location = local.location
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment