Google Data catalog Tag Template

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

google_data_catalog_tag_template (Terraform)

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

Example Usage from GitHub

data_catalog_templates.tf#L1
resource "google_data_catalog_tag_template" "data_governance_tag_template" {
  tag_template_id = "data_governance_mock"
  project         = var.proj_id
  display_name    = "Data Governance Mock"
  region          = "us-east1"
  force_delete    = true
main.tf#L23
resource "google_data_catalog_tag_template" "data_eng_template" {
  provider               = google.access_token
  tag_template_id = "data_eng_template"
  region = var.tag_template_region
  display_name = "Data Engineering Template"

main.tf#L7
resource "google_data_catalog_tag_template" "this" {
  display_name    = var.display_name
  force_delete    = var.force_delete
  project         = var.project
  region          = var.region
  tag_template_id = var.tag_template_id
main.tf#L7
resource "google_data_catalog_tag_template" "tag_template" {
  for_each        = local.tag_template
  project         = var.project_id
  region          = var.region
  tag_template_id = lower(each.key)
  display_name    = each.value["display_name"]

Parameters

  • display_name optional - string
    • The display name for this template.

  • force_delete optional - bool
    • This confirms the deletion of any possible tags using this template. Must be set to true in order to delete the tag template.

  • id optionalcomputed - string
  • name requiredcomputed - string
    • The resource name of the tag template in URL format. Example: projects/{project_id}/locations/{location}/tagTemplates/{tagTemplateId}

  • project optionalcomputed - string
  • region optionalcomputed - string
    • Template location region.

  • tag_template_id required - string
    • The id of the tag template to create.

Explanation in Terraform Registry

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:

Frequently asked questions

What is Google Data catalog Tag Template?

Google Data catalog Tag Template 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 Template?

For Terraform, the JCFlores93/data-catalog-mock-error, mesmacosta/google-datacatalog-governance-best-pratices and niveklabs/google source code examples are useful. See the Terraform Example section for further details.

security-icon

Scan your IaC problem in 3 minutes for free

You can keep your IaC security for free. No credit card required.