Google Data loss prevention Deidentify Template

This page shows how to write Terraform for Data loss prevention Deidentify Template and write them securely.

google_data_loss_prevention_deidentify_template (Terraform)

The Deidentify Template in Data loss prevention can be configured in Terraform with the resource name google_data_loss_prevention_deidentify_template. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

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).


A description of the template.

User set display name of the template.

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

The resource name of the template. Set by the server.

The parent of the template in any of the following formats: 'projects/[[project]]' 'projects/[[project]]/locations/[[location]]' 'organizations/[[organization_id]]' 'organizations/[[organization_id]]/locations/[[location]]'

  • deidentify_config list block
    • info_type_transformations list block
      • transformations list block
        • info_types list block

          Name of the information type.

        • primitive_transformation list block
          • character_mask_config list block

            Character to use to mask the sensitive values—for example, for an alphabetic string such as a name, or 0 for a numeric string such as ZIP code or credit card number. This string must have a length of 1. If not supplied, this value defaults to for strings, and 0 for digits.

            Number of characters to mask. If not set, all matching chars will be masked. Skipped characters do not count towards this tally.

            Mask characters in reverse order. For example, if masking_character is 0, number_to_mask is 14, and reverse_order is 'false', then the input string '1234-5678-9012-3456' is masked as '00000000000000-3456'.

            • characters_to_ignore list block

              Characters to not transform when masking.

              Common characters to not transform when masking. Useful to avoid removing punctuation. Possible values: ["NUMERIC", "ALPHA_UPPER_CASE", "ALPHA_LOWER_CASE", "PUNCTUATION", "WHITESPACE"]

          • replace_config list block
            • new_value list block

              A boolean value.

              Represents a day of the week. Possible values: ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"]

              A float value.

              An integer value.

              A string value.

              A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

              • date_value list block
                • day optional - number

                Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant.

                Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day.

                Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year.

              • time_value list block

                Hours of day in 24 hour format. Should be from 0 to 23.

                Minutes of hour of day. Must be from 0 to 59.

                Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

                Seconds of minutes of the time. Must normally be from 0 to 59.

  • timeouts single block

Explanation in Terraform Registry

Allows creation of templates to de-identify content. To get more information about DeidentifyTemplate, see:

Frequently asked questions

What is Google Data loss prevention Deidentify Template?

Google Data loss prevention Deidentify Template is a resource for Data loss prevention of Google Cloud Platform. Settings can be wrote in Terraform.


Automate config file reviews on your commits

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