@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
163 lines • 6.94 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.EnvironmentDebugmask = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Manages the debug mask singleton for an Apigee environment. The debug mask
* configuration restricts which data is captured (masked) in API proxy debug
* sessions for an environment.
*
* The debug mask always exists for every environment and cannot be created or
* deleted through the API. Terraform manages it via `GET`/`PATCH` on the
* environment's `debugmask` sub-resource. Creating the resource sets the
* configured masks, and destroying it clears all masks.
*
* To get more information about EnvironmentDebugmask, see:
*
* * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments/getDebugmask)
* * How-to Guides
* * [Masking sensitive data](https://cloud.google.com/apigee/docs/api-platform/debug/masking-data)
*
* ## Example Usage
*
* ### Apigee Environment Debugmask Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const debugmask = new gcp.apigee.EnvironmentDebugmask("debugmask", {
* envId: apigeeEnv.id,
* requestXPaths: ["/request/headers/header[@name=\"x-secret\"]"],
* responseXPaths: ["/response/body/token"],
* variables: ["request.header.apikey"],
* });
* ```
*
* ### Apigee Environment Debugmask Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const debugmask = new gcp.apigee.EnvironmentDebugmask("debugmask", {
* envId: apigeeEnv.id,
* requestXPaths: [
* "/request/headers/header[@name=\"x-secret\"]",
* "/request/body/password",
* ],
* responseXPaths: ["/response/body/token"],
* faultXPaths: ["/fault/faultstring"],
* requestJsonPaths: ["$.store.book[*].author"],
* responseJsonPaths: ["$.store.book[*].price"],
* variables: [
* "request.header.apikey",
* "request.header.x-token",
* ],
* namespaces: {
* ns: "http://example.com",
* },
* });
* ```
*
* ## Import
*
* EnvironmentDebugmask can be imported using any of these accepted formats:
*
* * `{{env_id}}/debugmask`
* * `organizations/{{org_name}}/environments/{{env_name}}`
*
* When using the `pulumi import` command, EnvironmentDebugmask can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:apigee/environmentDebugmask:EnvironmentDebugmask default {{env_id}}/debugmask
* $ pulumi import gcp:apigee/environmentDebugmask:EnvironmentDebugmask default organizations/{{org_name}}/environments/{{env_name}}
* ```
*/
class EnvironmentDebugmask extends pulumi.CustomResource {
/**
* Get an existing EnvironmentDebugmask 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 EnvironmentDebugmask(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:apigee/environmentDebugmask:EnvironmentDebugmask';
/**
* Returns true if the given object is an instance of EnvironmentDebugmask. 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'] === EnvironmentDebugmask.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["envId"] = state?.envId;
resourceInputs["faultXPaths"] = state?.faultXPaths;
resourceInputs["name"] = state?.name;
resourceInputs["namespaces"] = state?.namespaces;
resourceInputs["requestJsonPaths"] = state?.requestJsonPaths;
resourceInputs["requestXPaths"] = state?.requestXPaths;
resourceInputs["responseJsonPaths"] = state?.responseJsonPaths;
resourceInputs["responseXPaths"] = state?.responseXPaths;
resourceInputs["variables"] = state?.variables;
}
else {
const args = argsOrState;
if (args?.envId === undefined && !opts.urn) {
throw new Error("Missing required property 'envId'");
}
resourceInputs["envId"] = args?.envId;
resourceInputs["faultXPaths"] = args?.faultXPaths;
resourceInputs["namespaces"] = args?.namespaces;
resourceInputs["requestJsonPaths"] = args?.requestJsonPaths;
resourceInputs["requestXPaths"] = args?.requestXPaths;
resourceInputs["responseJsonPaths"] = args?.responseJsonPaths;
resourceInputs["responseXPaths"] = args?.responseXPaths;
resourceInputs["variables"] = args?.variables;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(EnvironmentDebugmask.__pulumiType, name, resourceInputs, opts);
}
}
exports.EnvironmentDebugmask = EnvironmentDebugmask;
//# sourceMappingURL=environmentDebugmask.js.map