google_data_loss_prevention_stored_info_type

Allows creation of custom info types.

To get more information about StoredInfoType, see:

Example Usage - Dlp Stored Info Type Basic

resource "google_data_loss_prevention_stored_info_type" "basic" {
    parent = "projects/my-project-name"
    description = "Description"
    display_name = "Displayname"

    regex {
        pattern = "patient"
        group_indexes = [2]
    }
}

Example Usage - Dlp Stored Info Type Dictionary

resource "google_data_loss_prevention_stored_info_type" "dictionary" {
    parent = "projects/my-project-name"
    description = "Description"
    display_name = "Displayname"

    dictionary {
        word_list {
            words = ["word", "word2"]
        }
    }
}

Example Usage - Dlp Stored Info Type Large Custom Dictionary

resource "google_data_loss_prevention_stored_info_type" "large" {
    parent = "projects/my-project-name"
    description = "Description"
    display_name = "Displayname"

    large_custom_dictionary {
        cloud_storage_file_set {
            url = "gs://${google_storage_bucket.bucket.name}/${google_storage_bucket_object.object.name}"
        }
        output_path {
            path = "gs://${google_storage_bucket.bucket.name}/output/dictionary.txt"
        }
    }
}

resource "google_storage_bucket" "bucket" {
  name          = "tf-test-bucket"
  location      = "US"
  force_destroy = true
}

resource "google_storage_bucket_object" "object" {
  name   = "tf-test-object"
  bucket = google_storage_bucket.bucket.name
  source = "./test-fixtures/words.txt"
}

Example Usage - Dlp Stored Info Type With Id

resource "google_data_loss_prevention_stored_info_type" "with_stored_info_type_id" {
  parent = "projects/my-project-name"
  description = "Description"
  display_name = "Displayname"
  stored_info_type_id = "id-"

  regex {
    pattern = "patient"
    group_indexes = [2]
  }
}

Argument Reference

The following arguments are supported:


The regex block supports:

The dictionary block supports:

The word_list block supports:

The cloud_storage_path block supports:

The large_custom_dictionary block supports:

The output_path block supports:

The cloud_storage_file_set block supports:

The big_query_field block supports:

The table block supports:

The field 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

StoredInfoType can be imported using any of these accepted formats:

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

import {
  id = "{{parent}}/storedInfoTypes/{{name}}"
  to = google_data_loss_prevention_stored_info_type.default
}

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

$ terraform import google_data_loss_prevention_stored_info_type.default {{parent}}/storedInfoTypes/{{name}}
$ terraform import google_data_loss_prevention_stored_info_type.default {{parent}}/{{name}}