@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
129 lines • 5.39 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppCheckRecaptchaEnterpriseConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* An app's reCAPTCHA Enterprise configuration object.
*
* To get more information about RecaptchaEnterpriseConfig, see:
*
* * [API documentation](https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.recaptchaEnterpriseConfig)
* * How-to Guides
* * [Official Documentation](https://firebase.google.com/docs/app-check)
*
* ## Example Usage
*
* ### Firebase App Check Recaptcha Enterprise Config Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as time from "@pulumiverse/time";
*
* // Enables the reCAPTCHA Enterprise API
* const recaptchaEnterprise = new gcp.projects.Service("recaptcha_enterprise", {
* project: "my-project-name",
* service: "recaptchaenterprise.googleapis.com",
* });
* const _default = new gcp.firebase.WebApp("default", {
* project: "my-project-name",
* displayName: "Web App for reCAPTCHA Enterprise",
* });
* // 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.index.Sleep("wait_30s", {createDuration: "30s"}, {
* dependsOn: [_default],
* });
* const defaultAppCheckRecaptchaEnterpriseConfig = new gcp.firebase.AppCheckRecaptchaEnterpriseConfig("default", {
* project: "my-project-name",
* appId: _default.appId,
* siteKey: "6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw",
* tokenTtl: "7200s",
* }, {
* dependsOn: [wait30s],
* });
* ```
*
* ## Import
*
* RecaptchaEnterpriseConfig can be imported using any of these accepted formats:
*
* * `projects/{{project}}/apps/{{app_id}}/recaptchaEnterpriseConfig`
*
* * `{{project}}/{{app_id}}`
*
* * `{{app_id}}`
*
* When using the `pulumi import` command, RecaptchaEnterpriseConfig can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default projects/{{project}}/apps/{{app_id}}/recaptchaEnterpriseConfig
* ```
*
* ```sh
* $ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default {{project}}/{{app_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default {{app_id}}
* ```
*/
class AppCheckRecaptchaEnterpriseConfig extends pulumi.CustomResource {
/**
* Get an existing AppCheckRecaptchaEnterpriseConfig 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 AppCheckRecaptchaEnterpriseConfig(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AppCheckRecaptchaEnterpriseConfig. 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'] === AppCheckRecaptchaEnterpriseConfig.__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["siteKey"] = state?.siteKey;
resourceInputs["tokenTtl"] = state?.tokenTtl;
}
else {
const args = argsOrState;
if (args?.appId === undefined && !opts.urn) {
throw new Error("Missing required property 'appId'");
}
if (args?.siteKey === undefined && !opts.urn) {
throw new Error("Missing required property 'siteKey'");
}
resourceInputs["appId"] = args?.appId;
resourceInputs["project"] = args?.project;
resourceInputs["siteKey"] = args?.siteKey;
resourceInputs["tokenTtl"] = args?.tokenTtl;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AppCheckRecaptchaEnterpriseConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.AppCheckRecaptchaEnterpriseConfig = AppCheckRecaptchaEnterpriseConfig;
/** @internal */
AppCheckRecaptchaEnterpriseConfig.__pulumiType = 'gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig';
//# sourceMappingURL=appCheckRecaptchaEnterpriseConfig.js.map
;