@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
256 lines • 10.2 kB
JavaScript
;
// *** 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.PreventionDeidentifyTemplate = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* 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}}
* $ pulumi import gcp:dataloss/preventionDeidentifyTemplate:PreventionDeidentifyTemplate default {{parent}}/{{name}}
* ```
*/
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, id, state, opts) {
return new PreventionDeidentifyTemplate(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:dataloss/preventionDeidentifyTemplate: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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === PreventionDeidentifyTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["deidentifyConfig"] = state?.deidentifyConfig;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["description"] = state?.description;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["name"] = state?.name;
resourceInputs["parent"] = state?.parent;
resourceInputs["templateId"] = state?.templateId;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.deidentifyConfig === undefined && !opts.urn) {
throw new Error("Missing required property 'deidentifyConfig'");
}
if (args?.parent === undefined && !opts.urn) {
throw new Error("Missing required property 'parent'");
}
resourceInputs["deidentifyConfig"] = args?.deidentifyConfig;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["description"] = args?.description;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["parent"] = args?.parent;
resourceInputs["templateId"] = args?.templateId;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PreventionDeidentifyTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.PreventionDeidentifyTemplate = PreventionDeidentifyTemplate;
//# sourceMappingURL=preventionDeidentifyTemplate.js.map