google_data_catalog_tag_template

A tag template defines a tag, which can have one or more typed fields. The template is used to create and attach the tag to GCP resources.

To get more information about TagTemplate, see:

Open in Cloud Shell

Example Usage - Data Catalog Tag Template Basic

resource "google_data_catalog_tag_template" "basic_tag_template" {
  tag_template_id = "my_template"
  region = "us-central1"
  display_name = "Demo Tag Template"

  fields {
    field_id = "source"
    display_name = "Source of data asset"
    type {
      primitive_type = "STRING"
    }
    is_required = true
  }

  fields {
    field_id = "num_rows"
    display_name = "Number of rows in the data asset"
    type {
      primitive_type = "DOUBLE"
    }
  }

  fields {
    field_id = "pii_type"
    display_name = "PII type"
    type {
      enum_type {
        allowed_values {
          display_name = "EMAIL"
        }
        allowed_values {
          display_name = "SOCIAL SECURITY NUMBER"
        }
        allowed_values {
          display_name = "NONE"
        }
      }
    }
  }

  force_delete = "false"
}

Argument Reference

The following arguments are supported:

The fields block supports:

The type block supports:

The enum_type block supports:

The allowed_values block supports:


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

TagTemplate can be imported using any of these accepted formats:

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

import {
  id = "{{name}}"
  to = google_data_catalog_tag_template.default
}

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

$ terraform import google_data_catalog_tag_template.default {{name}}

User Project Overrides

This resource supports User Project Overrides.