Google Data catalog Tag

This page shows how to write Terraform for Data catalog Tag and write them securely.

google_data_catalog_tag (Terraform)

The Tag in Data catalog can be configured in Terraform with the resource name google_data_catalog_tag. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L7
resource "google_data_catalog_tag" "this" {
  column   = var.column
  parent   = var.parent
  template = var.template

  dynamic "fields" {
main.tf#L5
resource "google_data_catalog_tag" "tag" {
    for_each = local.tags
    template = coalesce(var.tag_templates[each.value.tag_template_id]["name"])
    parent   = coalesce(var.entry_groups[each.value.parent]["name"])
    column   = each.value.column

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Resources like Entry can have schemas associated with them. This scope allows users to attach tags to an individual column based on that schema. For attaching a tag to a nested column, use '.' to separate the column names. Example: 'outer_column.inner_column'

  • id optional computed - string
  • name optional computed - string

The resource name of the tag in URL format. Example: projects/[project_id]/locations/[location]/entrygroups/[entryGroupId]/entries/[entryId]/tags/[tag_id] or projects/[project_id]/locations/[location]/entrygroups/[entryGroupId]/tags/[tag_id] where tag_id is a system-generated identifier. Note that this Tag may not actually be stored in the location in this name.

The name of the parent this tag is attached to. This can be the name of an entry or an entry group. If an entry group, the tag will be attached to all entries in that group.

The resource name of the tag template that this tag uses. Example: projects/[project_id]/locations/[location]/tagTemplates/[tagTemplateId] This field cannot be modified after creation.

The display name of the tag template.

  • fields set block

    Holds the value for a tag field with boolean type.

    The display name of this field

    Holds the value for a tag field with double type.

    The display name of the enum value.

    The order of this field with respect to other fields in this tag. For example, a higher value can indicate a more important field. The value can be negative. Multiple fields can have the same order, and field orders within a tag do not have to be sequential.

    Holds the value for a tag field with string type.

    Holds the value for a tag field with timestamp type.

  • timeouts single block

Explanation in Terraform Registry

Tags are used to attach custom metadata to Data Catalog resources. Tags conform to the specifications within their tag template. See Data Catalog IAM for information on the permissions needed to create or view tags. To get more information about Tag, see:

Frequently asked questions

What is Google Data catalog Tag?

Google Data catalog Tag is a resource for Data catalog of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Data catalog Tag?

For Terraform, the niveklabs/google and drandell/terraform-google-datacatalog source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.