UNPKG

@pulumi/gcp

Version:

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

149 lines 6.56 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.AppCheckDebugToken = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * A debug token is a secret used during the development or integration testing of * an app. It essentially allows the development or integration testing to bypass * app attestation while still allowing App Check to enforce protection on supported * production Firebase services. * * To get more information about DebugToken, see: * * * [API documentation](https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.debugTokens) * * How-to Guides * * [Official Documentation](https://firebase.google.com/docs/app-check) * * ## Example Usage * * ### Firebase App Check Debug Token Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const _default = new gcp.firebase.WebApp("default", { * project: "my-project-name", * displayName: "Web App for debug token", * }); * // It takes a while for App Check to recognize the new app * // If your app already exists, you don't have to wait 30 seconds. * const wait30s = new time.Sleep("wait_30s", {createDuration: "30s"}, { * dependsOn: [_default], * }); * const defaultAppCheckDebugToken = new gcp.firebase.AppCheckDebugToken("default", { * project: "my-project-name", * appId: _default.appId, * displayName: "Debug Token", * token: "00000000-AAAA-BBBB-CCCC-000000000000", * }, { * dependsOn: [wait30s], * }); * ``` * * ## Import * * DebugToken can be imported using any of these accepted formats: * * * `projects/{{project}}/apps/{{app_id}}/debugTokens/{{debug_token_id}}` * * `{{project}}/{{app_id}}/{{debug_token_id}}` * * `{{app_id}}/{{debug_token_id}}` * * When using the `pulumi import` command, DebugToken can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default projects/{{project}}/apps/{{app_id}}/debugTokens/{{debug_token_id}} * $ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default {{project}}/{{app_id}}/{{debug_token_id}} * $ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default {{app_id}}/{{debug_token_id}} * ``` */ class AppCheckDebugToken extends pulumi.CustomResource { /** * Get an existing AppCheckDebugToken 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 AppCheckDebugToken(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:firebase/appCheckDebugToken:AppCheckDebugToken'; /** * Returns true if the given object is an instance of AppCheckDebugToken. 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'] === AppCheckDebugToken.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["appId"] = state?.appId; resourceInputs["debugTokenId"] = state?.debugTokenId; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["displayName"] = state?.displayName; resourceInputs["project"] = state?.project; resourceInputs["token"] = state?.token; } else { const args = argsOrState; if (args?.appId === undefined && !opts.urn) { throw new Error("Missing required property 'appId'"); } if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.token === undefined && !opts.urn) { throw new Error("Missing required property 'token'"); } resourceInputs["appId"] = args?.appId; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["displayName"] = args?.displayName; resourceInputs["project"] = args?.project; resourceInputs["token"] = args?.token ? pulumi.secret(args.token) : undefined; resourceInputs["debugTokenId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["token"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(AppCheckDebugToken.__pulumiType, name, resourceInputs, opts); } } exports.AppCheckDebugToken = AppCheckDebugToken; //# sourceMappingURL=appCheckDebugToken.js.map