google_data_loss_prevention_inspect_template

An inspect job template.

To get more information about InspectTemplate, see:

Example Usage - Dlp Inspect Template Basic

resource "google_data_loss_prevention_inspect_template" "basic" {
    parent = "projects/my-project-name"
    description = "My description"
    display_name = "display_name"

    inspect_config {
        info_types {
            name = "EMAIL_ADDRESS"
        }
        info_types {
            name = "PERSON_NAME"
        }
        info_types {
            name = "LAST_NAME"
        }
        info_types {
            name = "DOMAIN_NAME"
        }
        info_types {
            name = "PHONE_NUMBER"
        }
        info_types {
            name = "FIRST_NAME"
        }

        min_likelihood = "UNLIKELY"
        rule_set {
            info_types {
                name = "EMAIL_ADDRESS"
            }
            rules {
                exclusion_rule {
                    regex {
                        pattern = ".+@example.com"
                    }
                    matching_type = "MATCHING_TYPE_FULL_MATCH"
                }
            }
        }
        rule_set {
            info_types {
                name = "EMAIL_ADDRESS"
            }
            info_types {
                name = "DOMAIN_NAME"
            }
            info_types {
                name = "PHONE_NUMBER"
            }
            info_types {
                name = "PERSON_NAME"
            }
            info_types {
                name = "FIRST_NAME"
            }
            rules {
                exclusion_rule {
                    dictionary {
                        word_list {
                            words = ["TEST"]
                        }
                    }
                    matching_type = "MATCHING_TYPE_PARTIAL_MATCH"
                }
            }
        }

        rule_set {
            info_types {
                name = "PERSON_NAME"
            }
            rules {
                hotword_rule {
                    hotword_regex {
                        pattern = "patient"
                    }
                    proximity {
                        window_before = 50
                    }
                    likelihood_adjustment {
                        fixed_likelihood = "VERY_LIKELY"
                    }
                }
            }
        }

        limits {
            max_findings_per_item    = 10
            max_findings_per_request = 50
            max_findings_per_info_type {
                max_findings = "75"
                info_type {
                    name = "PERSON_NAME"
                }
            }
            max_findings_per_info_type {
                max_findings = "80"
                info_type {
                    name = "LAST_NAME"
                }
            }
        }
    }
}

Example Usage - Dlp Inspect Template Custom Type

resource "google_data_loss_prevention_inspect_template" "custom" {
    parent = "projects/my-project-name"
    description = "My description"
    display_name = "display_name"

    inspect_config {
        custom_info_types {
            info_type {
                name = "MY_CUSTOM_TYPE"
            }

            likelihood = "UNLIKELY"

            regex {
                pattern = "test*"
            }
        }

        info_types {
            name = "EMAIL_ADDRESS"
        }

        min_likelihood = "UNLIKELY"
        rule_set {
            info_types {
                name = "EMAIL_ADDRESS"
            }
            rules {
                exclusion_rule {
                    regex {
                        pattern = ".+@example.com"
                    }
                    matching_type = "MATCHING_TYPE_FULL_MATCH"
                }
            }
        }

        rule_set {
            info_types {
                name = "MY_CUSTOM_TYPE"
            }
            rules {
                hotword_rule {
                    hotword_regex {
                        pattern = "example*"
                    }
                    proximity {
                        window_before = 50
                    }
                    likelihood_adjustment {
                        fixed_likelihood = "VERY_LIKELY"
                    }
                }
            }
        }

        limits {
            max_findings_per_item    = 10
            max_findings_per_request = 50
        }
    }
}

Example Usage - Dlp Inspect Template Custom Type Surrogate

resource "google_data_loss_prevention_inspect_template" "custom_type_surrogate" {
  parent = "projects/my-project-name"
  description = "My description"
  display_name = "display_name"

  inspect_config {
    custom_info_types {
      info_type {
        name = "MY_CUSTOM_TYPE"
      }

      likelihood = "UNLIKELY"

      surrogate_type {}
    }

    info_types {
      name = "EMAIL_ADDRESS"
    }

    min_likelihood = "UNLIKELY"
    rule_set {
      info_types {
        name = "EMAIL_ADDRESS"
      }
      rules {
        exclusion_rule {
          regex {
            pattern = ".+@example.com"
          }
          matching_type = "MATCHING_TYPE_FULL_MATCH"
        }
      }
    }

    rule_set {
      info_types {
        name = "MY_CUSTOM_TYPE"
      }
      rules {
        hotword_rule {
          hotword_regex {
            pattern = "example*"
          }
          proximity {
            window_before = 50
          }
          likelihood_adjustment {
            fixed_likelihood = "VERY_LIKELY"
          }
        }
      }
    }

    limits {
      max_findings_per_item    = 10
      max_findings_per_request = 50
    }
  }
}

Argument Reference

The following arguments are supported:


The inspect_config block supports:

The limits block supports:

The max_findings_per_info_type block supports:

The info_type block supports:

The sensitivity_score block supports:

The info_types block supports:

The sensitivity_score block supports:

The rule_set block supports:

The info_types block supports:

The sensitivity_score block supports:

The rules block supports:

The hotword_rule block supports:

The hotword_regex block supports:

The proximity block supports:

The likelihood_adjustment block supports:

The exclusion_rule block supports:

The dictionary block supports:

The word_list block supports:

The cloud_storage_path block supports:

The regex block supports:

The exclude_info_types block supports:

The info_types block supports:

The sensitivity_score block supports:

The exclude_by_hotword block supports:

The hotword_regex block supports:

The proximity block supports:

The custom_info_types block supports:

The info_type block supports:

The sensitivity_score block supports:

The sensitivity_score block supports:

The regex block supports:

The dictionary block supports:

The word_list block supports:

The cloud_storage_path block supports:

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

InspectTemplate can be imported using any of these accepted formats:

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

import {
  id = "{{parent}}/inspectTemplates/{{name}}"
  to = google_data_loss_prevention_inspect_template.default
}

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

$ terraform import google_data_loss_prevention_inspect_template.default {{parent}}/inspectTemplates/{{name}}
$ terraform import google_data_loss_prevention_inspect_template.default {{parent}}/{{name}}