UNPKG

@pulumi/gcp

Version:

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

310 lines (309 loc) • 11.5 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Allows creation of templates to de-identify content. * * To get more information about DeidentifyTemplate, see: * * * [API documentation](https://cloud.google.com/dlp/docs/reference/rest/v2/projects.deidentifyTemplates) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dlp/docs/concepts-templates) * * ## Example Usage * * ### Dlp Deidentify Template Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basic = new gcp.dataloss.PreventionDeidentifyTemplate("basic", { * parent: "projects/my-project-name", * description: "Description", * displayName: "Displayname", * deidentifyConfig: { * infoTypeTransformations: { * transformations: [ * { * infoTypes: [{ * name: "FIRST_NAME", * }], * primitiveTransformation: { * replaceWithInfoTypeConfig: true, * }, * }, * { * infoTypes: [ * { * name: "PHONE_NUMBER", * }, * { * name: "AGE", * }, * ], * primitiveTransformation: { * replaceConfig: { * newValue: { * integerValue: 9, * }, * }, * }, * }, * { * infoTypes: [ * { * name: "EMAIL_ADDRESS", * }, * { * name: "LAST_NAME", * }, * ], * primitiveTransformation: { * characterMaskConfig: { * maskingCharacter: "X", * numberToMask: 4, * reverseOrder: true, * charactersToIgnores: [{ * commonCharactersToIgnore: "PUNCTUATION", * }], * }, * }, * }, * { * infoTypes: [{ * name: "DATE_OF_BIRTH", * }], * primitiveTransformation: { * replaceConfig: { * newValue: { * dateValue: { * year: 2020, * month: 1, * day: 1, * }, * }, * }, * }, * }, * { * infoTypes: [{ * name: "CREDIT_CARD_NUMBER", * }], * primitiveTransformation: { * cryptoDeterministicConfig: { * context: { * name: "sometweak", * }, * cryptoKey: { * transient: { * name: "beep", * }, * }, * surrogateInfoType: { * name: "abc", * }, * }, * }, * }, * ], * }, * }, * }); * ``` * ### Dlp Deidentify Template Image Transformations * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basic = new gcp.dataloss.PreventionDeidentifyTemplate("basic", { * parent: "projects/my-project-name", * description: "Description", * displayName: "Displayname", * deidentifyConfig: { * imageTransformations: { * transforms: [ * { * redactionColor: { * red: 0.5, * blue: 1, * green: 0.2, * }, * selectedInfoTypes: { * infoTypes: [{ * name: "COLOR_INFO", * version: "latest", * }], * }, * }, * { * allInfoTypes: {}, * }, * { * allText: {}, * }, * ], * }, * }, * }); * ``` * * ## Import * * DeidentifyTemplate can be imported using any of these accepted formats: * * * `{{parent}}/deidentifyTemplates/{{name}}` * * * `{{parent}}/{{name}}` * * When using the `pulumi import` command, DeidentifyTemplate can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:dataloss/preventionDeidentifyTemplate:PreventionDeidentifyTemplate default {{parent}}/deidentifyTemplates/{{name}} * ``` * * ```sh * $ pulumi import gcp:dataloss/preventionDeidentifyTemplate:PreventionDeidentifyTemplate default {{parent}}/{{name}} * ``` */ export declare class PreventionDeidentifyTemplate extends pulumi.CustomResource { /** * Get an existing PreventionDeidentifyTemplate 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: string, id: pulumi.Input<pulumi.ID>, state?: PreventionDeidentifyTemplateState, opts?: pulumi.CustomResourceOptions): PreventionDeidentifyTemplate; /** * Returns true if the given object is an instance of PreventionDeidentifyTemplate. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is PreventionDeidentifyTemplate; /** * The creation timestamp of an deidentifyTemplate. Set by the server. */ readonly createTime: pulumi.Output<string>; /** * Configuration of the deidentify template * Structure is documented below. */ readonly deidentifyConfig: pulumi.Output<outputs.dataloss.PreventionDeidentifyTemplateDeidentifyConfig>; /** * A description of the template. */ readonly description: pulumi.Output<string | undefined>; /** * User set display name of the template. */ readonly displayName: pulumi.Output<string | undefined>; /** * The resource name of the template. Set by the server. */ readonly name: pulumi.Output<string>; /** * 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}}` */ readonly parent: pulumi.Output<string>; /** * The template id can contain uppercase and lowercase letters, numbers, and hyphens; * that is, it must match the regular expression: [a-zA-Z\d-_]+. The maximum length is * 100 characters. Can be empty to allow the system to generate one. */ readonly templateId: pulumi.Output<string>; /** * The last update timestamp of an deidentifyTemplate. Set by the server. */ readonly updateTime: pulumi.Output<string>; /** * Create a PreventionDeidentifyTemplate resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: PreventionDeidentifyTemplateArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering PreventionDeidentifyTemplate resources. */ export interface PreventionDeidentifyTemplateState { /** * The creation timestamp of an deidentifyTemplate. Set by the server. */ createTime?: pulumi.Input<string>; /** * Configuration of the deidentify template * Structure is documented below. */ deidentifyConfig?: pulumi.Input<inputs.dataloss.PreventionDeidentifyTemplateDeidentifyConfig>; /** * A description of the template. */ description?: pulumi.Input<string>; /** * User set display name of the template. */ displayName?: pulumi.Input<string>; /** * The resource name of the template. Set by the server. */ name?: pulumi.Input<string>; /** * 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}}` */ parent?: pulumi.Input<string>; /** * The template id can contain uppercase and lowercase letters, numbers, and hyphens; * that is, it must match the regular expression: [a-zA-Z\d-_]+. The maximum length is * 100 characters. Can be empty to allow the system to generate one. */ templateId?: pulumi.Input<string>; /** * The last update timestamp of an deidentifyTemplate. Set by the server. */ updateTime?: pulumi.Input<string>; } /** * The set of arguments for constructing a PreventionDeidentifyTemplate resource. */ export interface PreventionDeidentifyTemplateArgs { /** * Configuration of the deidentify template * Structure is documented below. */ deidentifyConfig: pulumi.Input<inputs.dataloss.PreventionDeidentifyTemplateDeidentifyConfig>; /** * A description of the template. */ description?: pulumi.Input<string>; /** * User set display name of the template. */ displayName?: pulumi.Input<string>; /** * 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}}` */ parent: pulumi.Input<string>; /** * The template id can contain uppercase and lowercase letters, numbers, and hyphens; * that is, it must match the regular expression: [a-zA-Z\d-_]+. The maximum length is * 100 characters. Can be empty to allow the system to generate one. */ templateId?: pulumi.Input<string>; }