UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

382 lines • 13.4 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PreventionInspectTemplate = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * An inspect job template. * * To get more information about InspectTemplate, see: * * * [API documentation](https://cloud.google.com/dlp/docs/reference/rest/v2/projects.inspectTemplates) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dlp/docs/creating-templates-inspect) * * ## Example Usage * * ### Dlp Inspect Template Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basic = new gcp.dataloss.PreventionInspectTemplate("basic", { * parent: "projects/my-project-name", * description: "My description", * displayName: "display_name", * inspectConfig: { * infoTypes: [ * { * name: "EMAIL_ADDRESS", * }, * { * name: "PERSON_NAME", * }, * { * name: "LAST_NAME", * }, * { * name: "DOMAIN_NAME", * }, * { * name: "PHONE_NUMBER", * }, * { * name: "FIRST_NAME", * }, * ], * minLikelihood: "UNLIKELY", * ruleSets: [ * { * infoTypes: [{ * name: "EMAIL_ADDRESS", * }], * rules: [{ * exclusionRule: { * regex: { * pattern: ".+@example.com", * }, * matchingType: "MATCHING_TYPE_FULL_MATCH", * }, * }], * }, * { * infoTypes: [ * { * name: "EMAIL_ADDRESS", * }, * { * name: "DOMAIN_NAME", * }, * { * name: "PHONE_NUMBER", * }, * { * name: "PERSON_NAME", * }, * { * name: "FIRST_NAME", * }, * ], * rules: [{ * exclusionRule: { * dictionary: { * wordList: { * words: ["TEST"], * }, * }, * matchingType: "MATCHING_TYPE_PARTIAL_MATCH", * }, * }], * }, * { * infoTypes: [{ * name: "PERSON_NAME", * }], * rules: [{ * hotwordRule: { * hotwordRegex: { * pattern: "patient", * }, * proximity: { * windowBefore: 50, * }, * likelihoodAdjustment: { * fixedLikelihood: "VERY_LIKELY", * }, * }, * }], * }, * ], * limits: { * maxFindingsPerItem: 10, * maxFindingsPerRequest: 50, * maxFindingsPerInfoTypes: [ * { * maxFindings: 75, * infoType: { * name: "PERSON_NAME", * }, * }, * { * maxFindings: 80, * infoType: { * name: "LAST_NAME", * }, * }, * ], * }, * }, * }); * ``` * ### Dlp Inspect Template Custom Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const custom = new gcp.dataloss.PreventionInspectTemplate("custom", { * parent: "projects/my-project-name", * description: "My description", * displayName: "display_name", * inspectConfig: { * customInfoTypes: [{ * infoType: { * name: "MY_CUSTOM_TYPE", * }, * likelihood: "UNLIKELY", * regex: { * pattern: "test*", * }, * }], * infoTypes: [{ * name: "EMAIL_ADDRESS", * }], * minLikelihood: "UNLIKELY", * ruleSets: [ * { * infoTypes: [{ * name: "EMAIL_ADDRESS", * }], * rules: [{ * exclusionRule: { * regex: { * pattern: ".+@example.com", * }, * matchingType: "MATCHING_TYPE_FULL_MATCH", * }, * }], * }, * { * infoTypes: [{ * name: "MY_CUSTOM_TYPE", * }], * rules: [{ * hotwordRule: { * hotwordRegex: { * pattern: "example*", * }, * proximity: { * windowBefore: 50, * }, * likelihoodAdjustment: { * fixedLikelihood: "VERY_LIKELY", * }, * }, * }], * }, * ], * limits: { * maxFindingsPerItem: 10, * maxFindingsPerRequest: 50, * }, * }, * }); * ``` * ### Dlp Inspect Template Custom Type Surrogate * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const customTypeSurrogate = new gcp.dataloss.PreventionInspectTemplate("custom_type_surrogate", { * parent: "projects/my-project-name", * description: "My description", * displayName: "display_name", * inspectConfig: { * customInfoTypes: [{ * infoType: { * name: "MY_CUSTOM_TYPE", * }, * likelihood: "UNLIKELY", * surrogateType: {}, * }], * infoTypes: [{ * name: "EMAIL_ADDRESS", * }], * minLikelihood: "UNLIKELY", * ruleSets: [ * { * infoTypes: [{ * name: "EMAIL_ADDRESS", * }], * rules: [{ * exclusionRule: { * regex: { * pattern: ".+@example.com", * }, * matchingType: "MATCHING_TYPE_FULL_MATCH", * }, * }], * }, * { * infoTypes: [{ * name: "MY_CUSTOM_TYPE", * }], * rules: [{ * hotwordRule: { * hotwordRegex: { * pattern: "example*", * }, * proximity: { * windowBefore: 50, * }, * likelihoodAdjustment: { * fixedLikelihood: "VERY_LIKELY", * }, * }, * }], * }, * ], * limits: { * maxFindingsPerItem: 10, * maxFindingsPerRequest: 50, * }, * }, * }); * ``` * ### Dlp Inspect Template Max Infotype Per Finding Default * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const maxInfotypePerFindingDefault = new gcp.dataloss.PreventionInspectTemplate("max_infotype_per_finding_default", { * parent: "projects/my-project-name", * inspectConfig: { * infoTypes: [ * { * name: "EMAIL_ADDRESS", * }, * { * name: "PERSON_NAME", * }, * ], * minLikelihood: "UNLIKELY", * limits: { * maxFindingsPerRequest: 333, * maxFindingsPerItem: 222, * maxFindingsPerInfoTypes: [{ * maxFindings: 111, * }], * }, * }, * }); * ``` * * ## Import * * InspectTemplate can be imported using any of these accepted formats: * * * `{{parent}}/inspectTemplates/{{name}}` * * `{{parent}}/{{name}}` * * When using the `pulumi import` command, InspectTemplate can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:dataloss/preventionInspectTemplate:PreventionInspectTemplate default {{parent}}/inspectTemplates/{{name}} * $ pulumi import gcp:dataloss/preventionInspectTemplate:PreventionInspectTemplate default {{parent}}/{{name}} * ``` */ class PreventionInspectTemplate extends pulumi.CustomResource { /** * Get an existing PreventionInspectTemplate resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new PreventionInspectTemplate(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:dataloss/preventionInspectTemplate:PreventionInspectTemplate'; /** * Returns true if the given object is an instance of PreventionInspectTemplate. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === PreventionInspectTemplate.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["displayName"] = state?.displayName; resourceInputs["inspectConfig"] = state?.inspectConfig; resourceInputs["name"] = state?.name; resourceInputs["parent"] = state?.parent; resourceInputs["templateId"] = state?.templateId; } else { const args = argsOrState; if (args?.parent === undefined && !opts.urn) { throw new Error("Missing required property 'parent'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["displayName"] = args?.displayName; resourceInputs["inspectConfig"] = args?.inspectConfig; resourceInputs["parent"] = args?.parent; resourceInputs["templateId"] = args?.templateId; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PreventionInspectTemplate.__pulumiType, name, resourceInputs, opts); } } exports.PreventionInspectTemplate = PreventionInspectTemplate; //# sourceMappingURL=preventionInspectTemplate.js.map