@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
143 lines • 6.25 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.AppCheckRecaptchaV3Config = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* An app's reCAPTCHA V3 configuration object.
*
* To get more information about RecaptchaV3Config, see:
*
* * [API documentation](https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.recaptchaV3Config)
* * How-to Guides
* * [Official Documentation](https://firebase.google.com/docs/app-check)
*
* ## Example Usage
*
* ### Firebase App Check Recaptcha V3 Config 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 reCAPTCHA V3",
* });
* // 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 defaultAppCheckRecaptchaV3Config = new gcp.firebase.AppCheckRecaptchaV3Config("default", {
* project: "my-project-name",
* appId: _default.appId,
* siteSecret: "6Lf9YnQpAAAAAC3-MHmdAllTbPwTZxpUw5d34YzX",
* tokenTtl: "7200s",
* }, {
* dependsOn: [wait30s],
* });
* ```
*
* ## Import
*
* RecaptchaV3Config can be imported using any of these accepted formats:
*
* * `projects/{{project}}/apps/{{app_id}}/recaptchaV3Config`
* * `{{project}}/{{app_id}}`
* * `{{app_id}}`
*
* When using the `pulumi import` command, RecaptchaV3Config can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:firebase/appCheckRecaptchaV3Config:AppCheckRecaptchaV3Config default projects/{{project}}/apps/{{app_id}}/recaptchaV3Config
* $ pulumi import gcp:firebase/appCheckRecaptchaV3Config:AppCheckRecaptchaV3Config default {{project}}/{{app_id}}
* $ pulumi import gcp:firebase/appCheckRecaptchaV3Config:AppCheckRecaptchaV3Config default {{app_id}}
* ```
*/
class AppCheckRecaptchaV3Config extends pulumi.CustomResource {
/**
* Get an existing AppCheckRecaptchaV3Config 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 AppCheckRecaptchaV3Config(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:firebase/appCheckRecaptchaV3Config:AppCheckRecaptchaV3Config';
/**
* Returns true if the given object is an instance of AppCheckRecaptchaV3Config. 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'] === AppCheckRecaptchaV3Config.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["appId"] = state?.appId;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["siteSecret"] = state?.siteSecret;
resourceInputs["siteSecretSet"] = state?.siteSecretSet;
resourceInputs["tokenTtl"] = state?.tokenTtl;
}
else {
const args = argsOrState;
if (args?.appId === undefined && !opts.urn) {
throw new Error("Missing required property 'appId'");
}
if (args?.siteSecret === undefined && !opts.urn) {
throw new Error("Missing required property 'siteSecret'");
}
resourceInputs["appId"] = args?.appId;
resourceInputs["project"] = args?.project;
resourceInputs["siteSecret"] = args?.siteSecret ? pulumi.secret(args.siteSecret) : undefined;
resourceInputs["tokenTtl"] = args?.tokenTtl;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["siteSecretSet"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["siteSecret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(AppCheckRecaptchaV3Config.__pulumiType, name, resourceInputs, opts);
}
}
exports.AppCheckRecaptchaV3Config = AppCheckRecaptchaV3Config;
//# sourceMappingURL=appCheckRecaptchaV3Config.js.map