google_tags_tag_binding

A TagBinding represents a connection between a TagValue and a cloud resource (currently project, folder, or organization). Once a TagBinding is created, the TagValue is applied to all the descendants of the cloud resource.

To get more information about TagBinding, see:

Example Usage - Tag Binding Basic

resource "google_project" "project" {
    project_id = "project_id"
    name       = "project_id"
    org_id     = "123456789"
}

resource "google_tags_tag_key" "key" {
    parent = "organizations/123456789"
    short_name = "keyname"
    description = "For keyname resources."
}

resource "google_tags_tag_value" "value" {
    parent = "tagKeys/${google_tags_tag_key.key.name}"
    short_name = "valuename"
    description = "For valuename resources."
}

resource "google_tags_tag_binding" "binding" {
    parent = "//cloudresourcemanager.googleapis.com/projects/${google_project.project.number}"
    tag_value = "tagValues/${google_tags_tag_value.value.name}"
}

Argument Reference

The following arguments are supported:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

TagBinding can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import TagBinding using one of the formats above. For example:

import {
  id = "tagBindings/{{name}}"
  to = google_tags_tag_binding.default
}

When using the terraform import command, TagBinding can be imported using one of the formats above. For example:

$ terraform import google_tags_tag_binding.default tagBindings/{{name}}
$ terraform import google_tags_tag_binding.default {{name}}