Skip to content

googleTagsLocationTagBinding

A TagBinding represents a connection between a TagValue and a Regional 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 - Location Tag Binding Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.project.Project(this, "project", {
  name: "project_id",
  org_id: "123456789",
  project_id: "project_id",
});
const googleTagsTagKeyKey = new google.tagsTagKey.TagsTagKey(this, "key", {
  description: "For keyname resources.",
  parent: "organizations/123456789",
  short_name: "keyname",
});
const googleTagsTagValueValue = new google.tagsTagValue.TagsTagValue(
  this,
  "value",
  {
    description: "For valuename resources.",
    parent: `tagKeys/\${${googleTagsTagKeyKey.name}}`,
    short_name: "valuename",
  }
);
new google.tagsLocationTagBinding.TagsLocationTagBinding(this, "binding", {
  location: "us-central1",
  parent:
    "//run.googleapis.com/projects/${data.google_project.project.number}/locations/${google_cloud_run_service.default.location}/services/${google_cloud_run_service.default.name}",
  tag_value: `tagValues/\${${googleTagsTagValueValue.name}}`,
});

Argument Reference

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

  • tagValue - (Required) The TagValue of the TagBinding. Must be of the form tagValues/456.

  • location - (Required) Location of the resource.


Attributes Reference

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

  • id - an identifier for the resource with format {{location}}/{{name}}

  • name - The generated id for the TagBinding. This is a string of the form: tagBindings/{parent}/{tagValueName}

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

TagBinding can be imported using any of these accepted formats:

$ terraform import google_tags_location_tag_binding.default {{location}}/{{name}}