@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
135 lines • 4.69 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.WebApp = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A Google Cloud Firebase web application instance
*
* To get more information about WebApp, see:
*
* * [API documentation](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps)
* * How-to Guides
* * [Official Documentation](https://firebase.google.com/)
*
* ## Example Usage
*
* ### Firebase Web App Custom Api Key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const web = new gcp.projects.ApiKey("web", {
* project: "my-project-name",
* name: "api-key",
* displayName: "Display Name",
* restrictions: {
* browserKeyRestrictions: {
* allowedReferrers: ["*"],
* },
* },
* });
* const _default = new gcp.firebase.WebApp("default", {
* project: "my-project-name",
* displayName: "Display Name",
* apiKeyId: web.uid,
* deletionPolicy: "DELETE",
* });
* ```
*
* ## Import
*
* WebApp can be imported using any of these accepted formats:
*
* * `{{project}} projects/{{project}}/webApps/{{app_id}}`
*
* * `projects/{{project}}/webApps/{{app_id}}`
*
* * `{{project}}/{{project}}/{{app_id}}`
*
* * `webApps/{{app_id}}`
*
* * `{{app_id}}`
*
* When using the `pulumi import` command, WebApp can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:firebase/webApp:WebApp default "{{project}} projects/{{project}}/webApps/{{app_id}}"
* ```
*
* ```sh
* $ pulumi import gcp:firebase/webApp:WebApp default projects/{{project}}/webApps/{{app_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/webApp:WebApp default {{project}}/{{project}}/{{app_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/webApp:WebApp default webApps/{{app_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/webApp:WebApp default {{app_id}}
* ```
*/
class WebApp extends pulumi.CustomResource {
/**
* Get an existing WebApp 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 WebApp(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of WebApp. 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'] === WebApp.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["apiKeyId"] = state?.apiKeyId;
resourceInputs["appId"] = state?.appId;
resourceInputs["appUrls"] = state?.appUrls;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
}
else {
const args = argsOrState;
if (args?.displayName === undefined && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
resourceInputs["apiKeyId"] = args?.apiKeyId;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["project"] = args?.project;
resourceInputs["appId"] = undefined /*out*/;
resourceInputs["appUrls"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(WebApp.__pulumiType, name, resourceInputs, opts);
}
}
exports.WebApp = WebApp;
/** @internal */
WebApp.__pulumiType = 'gcp:firebase/webApp:WebApp';
//# sourceMappingURL=webApp.js.map
;