google_data_loss_prevention_deidentify_template

Allows creation of templates to de-identify content.

To get more information about DeidentifyTemplate, see:

Example Usage - Dlp Deidentify Template Basic

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

    deidentify_config {
        info_type_transformations {
            transformations {
                info_types {
                    name = "FIRST_NAME"
                }

                primitive_transformation {
                    replace_with_info_type_config = true
                }
            }

            transformations {
                info_types {
                    name = "PHONE_NUMBER"
                }
                info_types {
                    name = "AGE"
                }

                primitive_transformation {
                    replace_config {
                        new_value {
                            integer_value = 9
                        }
                    }
                }
            }

            transformations {
                info_types {
                    name = "EMAIL_ADDRESS"
                }
                info_types {
                    name = "LAST_NAME"
                }

                primitive_transformation {
                    character_mask_config {
                        masking_character = "X"
                        number_to_mask = 4
                        reverse_order = true
                        characters_to_ignore {
                            common_characters_to_ignore = "PUNCTUATION"
                        }
                    }
                }
            }

            transformations {
                info_types {
                    name = "DATE_OF_BIRTH"
                }

                primitive_transformation {
                    replace_config {
                        new_value {
                            date_value {
                                year  = 2020
                                month = 1
                                day   = 1
                            }
                        }
                    }
                }
            }

      transformations {
        info_types {
          name = "CREDIT_CARD_NUMBER"
        }

        primitive_transformation {
          crypto_deterministic_config {
            context {
              name = "sometweak"
            }
            crypto_key {
              transient {
                name = "beep"
              }
            }
            surrogate_info_type {
              name = "abc"
            }
          }
        }
      }
        }
    }
}

Example Usage - Dlp Deidentify Template Image Transformations

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

  deidentify_config {
    image_transformations {
      transforms {
        redaction_color {
          red = 0.5
          blue = 1
          green = 0.2
        }
        selected_info_types {
          info_types {
            name = "COLOR_INFO"
            version = "latest"
          }
        }
      }

      transforms {
        all_info_types {}
      }

      transforms {
        all_text {}
      }
    }
  }
}

Argument Reference

The following arguments are supported:

The deidentify_config block supports:

The image_transformations block supports:

The transforms block supports:

The redaction_color block supports:

The selected_info_types block supports:

The info_types block supports:

The sensitivity_score block supports:

The info_type_transformations block supports:

The transformations block supports:

The info_types block supports:

The sensitivity_score block supports:

The primitive_transformation block supports:

The replace_config block supports:

The new_value block supports:

The time_value block supports:

The date_value block supports:

The character_mask_config block supports:

The characters_to_ignore block supports:

The crypto_deterministic_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The surrogate_info_type block supports:

The sensitivity_score block supports:

The context block supports:

The crypto_replace_ffx_fpe_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The context block supports:

The surrogate_info_type block supports:

The sensitivity_score block supports:

The replace_dictionary_config block supports:

The word_list block supports:

The date_shift_config block supports:

The context block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The fixed_size_bucketing_config block supports:

The lower_bound block supports:

The upper_bound block supports:

The bucketing_config block supports:

The buckets block supports:

The min block supports:

The time_value block supports:

The date_value block supports:

The max block supports:

The time_value block supports:

The date_value block supports:

The replacement_value block supports:

The time_value block supports:

The date_value block supports:

The time_part_config block supports:

The crypto_hash_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The record_transformations block supports:

The field_transformations block supports:

The fields block supports:

The condition block supports:

The expressions block supports:

The conditions block supports:

The conditions block supports:

The field block supports:

The value block supports:

The time_value block supports:

The date_value block supports:

The primitive_transformation block supports:

The replace_config block supports:

The new_value block supports:

The time_value block supports:

The date_value block supports:

The character_mask_config block supports:

The characters_to_ignore block supports:

The crypto_replace_ffx_fpe_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The context block supports:

The surrogate_info_type block supports:

The sensitivity_score block supports:

The fixed_size_bucketing_config block supports:

The lower_bound block supports:

The time_value block supports:

The date_value block supports:

The upper_bound block supports:

The time_value block supports:

The date_value block supports:

The bucketing_config block supports:

The buckets block supports:

The min block supports:

The time_value block supports:

The date_value block supports:

The max block supports:

The time_value block supports:

The date_value block supports:

The replacement_value block supports:

The time_value block supports:

The date_value block supports:

The time_part_config block supports:

The crypto_hash_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The date_shift_config block supports:

The context block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The crypto_deterministic_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The surrogate_info_type block supports:

The sensitivity_score block supports:

The context block supports:

The replace_dictionary_config block supports:

The word_list block supports:

The info_type_transformations block supports:

The transformations block supports:

The info_types block supports:

The sensitivity_score block supports:

The primitive_transformation block supports:

The replace_config block supports:

The new_value block supports:

The time_value block supports:

The date_value block supports:

The character_mask_config block supports:

The characters_to_ignore block supports:

The crypto_replace_ffx_fpe_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The context block supports:

The surrogate_info_type block supports:

The sensitivity_score block supports:

The fixed_size_bucketing_config block supports:

The lower_bound block supports:

The upper_bound block supports:

The bucketing_config block supports:

The buckets block supports:

The min block supports:

The time_value block supports:

The date_value block supports:

The max block supports:

The time_value block supports:

The date_value block supports:

The replacement_value block supports:

The time_value block supports:

The date_value block supports:

The time_part_config block supports:

The crypto_hash_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The date_shift_config block supports:

The context block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The crypto_deterministic_config block supports:

The crypto_key block supports:

The transient block supports:

The unwrapped block supports:

The kms_wrapped block supports:

The surrogate_info_type block supports:

The sensitivity_score block supports:

The context block supports:

The replace_dictionary_config block supports:

The word_list block supports:

The record_suppressions block supports:

The condition block supports:

The expressions block supports:

The conditions block supports:

The conditions block supports:

The field block supports:

The value block supports:

The time_value block supports:

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

DeidentifyTemplate can be imported using any of these accepted formats:

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

import {
  id = "{{parent}}/deidentifyTemplates/{{name}}"
  to = google_data_loss_prevention_deidentify_template.default
}

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

$ terraform import google_data_loss_prevention_deidentify_template.default {{parent}}/deidentifyTemplates/{{name}}
$ terraform import google_data_loss_prevention_deidentify_template.default {{parent}}/{{name}}