Skip to content

possibility of inheriting multiple resource group tags to underlying resources #40

Answered by gettek
chanakanissanka asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @chanakanissanka.

Managing multiple tags with built-in or custom Policies is unfortunately a little tricky so understand the frustration.

One way I've overcome this is by creating multiple custom definitions for each Tag using the native resource azurerm_policy_definition, then including these in an initiative as below.

See also: #37

locals {
  tag_names = [
    "Application Name",
    "Cost Center",
    "Environment",
  ]
}

resource "azurerm_policy_definition" "modify_sub_inherit_tags" {
  for_each     = toset(local.tag_names)
  name         = "modify_inherit_sub_tag_${lower(replace(each.value, " ", "_"))}"
  display_name = "Inherit ${each.value} tag from the subscription"
  descript…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@chanakanissanka
Comment options

Answer selected by chanakanissanka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants