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:
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}"
}
The following arguments are supported:
parent
-
(Required)
The full resource name of the resource the TagValue is bound to. E.g. //cloudresourcemanager.googleapis.com/projects/123
tag_value
-
(Required)
The TagValue of the TagBinding. Must be of the form tagValues/456.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format tagBindings/{{name}}
name
-
The generated id for the TagBinding. This is a string of the form: tagBindings/{full-resource-name}/{tag-value-name}
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.delete
- Default is 20 minutes.TagBinding can be imported using any of these accepted formats:
tagBindings/{{name}}
{{name}}
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}}