UNPKG

@pulumi/gcp

Version:

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

243 lines • 9.95 kB
import * as pulumi from "@pulumi/pulumi"; /** * A Google Cloud Firebase web application instance * * > **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. * See Provider Versions for more details on beta resources. * * 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 Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const basicWebApp = new gcp.firebase.WebApp("basic", { * project: "my-project-name", * displayName: "Display Name Basic", * }); * const basic = gcp.firebase.getWebAppConfigOutput({ * webAppId: basicWebApp.appId, * }); * const _default = new gcp.storage.Bucket("default", { * name: "fb-webapp-", * location: "US", * }); * const defaultBucketObject = new gcp.storage.BucketObject("default", { * bucket: _default.name, * name: "firebase-config.json", * content: pulumi.jsonStringify({ * appId: basicWebApp.appId, * apiKey: basic.apply(basic => basic.apiKey), * authDomain: basic.apply(basic => basic.authDomain), * databaseURL: std.lookupOutput({ * map: basic, * key: "database_url", * "default": "", * }).apply(invoke => invoke.result), * storageBucket: std.lookupOutput({ * map: basic, * key: "storage_bucket", * "default": "", * }).apply(invoke => invoke.result), * messagingSenderId: std.lookupOutput({ * map: basic, * key: "messaging_sender_id", * "default": "", * }).apply(invoke => invoke.result), * measurementId: std.lookupOutput({ * map: basic, * key: "measurement_id", * "default": "", * }).apply(invoke => invoke.result), * }), * }); * ``` * ### 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 * $ terraform import google_firebase_web_app.default "{{project}} projects/{{project}}/webApps/{{app_id}}" * $ pulumi import gcp:firebase/webApp:WebApp default projects/{{project}}/webApps/{{app_id}} * $ pulumi import gcp:firebase/webApp:WebApp default {{project}}/{{project}}/{{app_id}} * $ pulumi import gcp:firebase/webApp:WebApp default webApps/{{app_id}} * $ pulumi import gcp:firebase/webApp:WebApp default {{app_id}} * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: WebAppState, opts?: pulumi.CustomResourceOptions): WebApp; /** * 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: any): obj is WebApp; /** * The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the WebApp. * If apiKeyId is not set during creation, then Firebase automatically associates an apiKeyId with the WebApp. * This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned. */ readonly apiKeyId: pulumi.Output<string>; /** * The globally unique, Firebase-assigned identifier of the App. * This identifier should be treated as an opaque token, as the data format is not specified. */ readonly appId: pulumi.Output<string>; /** * The URLs where the `WebApp` is hosted. */ readonly appUrls: pulumi.Output<string[]>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ readonly deletionPolicy: pulumi.Output<string>; /** * The user-assigned display name of the App. */ readonly displayName: pulumi.Output<string>; /** * The fully qualified resource name of the App, for example: * projects/projectId/webApps/appId */ readonly name: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * Create a WebApp resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: WebAppArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering WebApp resources. */ export interface WebAppState { /** * The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the WebApp. * If apiKeyId is not set during creation, then Firebase automatically associates an apiKeyId with the WebApp. * This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned. */ apiKeyId?: pulumi.Input<string | undefined>; /** * The globally unique, Firebase-assigned identifier of the App. * This identifier should be treated as an opaque token, as the data format is not specified. */ appId?: pulumi.Input<string | undefined>; /** * The URLs where the `WebApp` is hosted. */ appUrls?: pulumi.Input<pulumi.Input<string>[] | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * The user-assigned display name of the App. */ displayName?: pulumi.Input<string | undefined>; /** * The fully qualified resource name of the App, for example: * projects/projectId/webApps/appId */ name?: pulumi.Input<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a WebApp resource. */ export interface WebAppArgs { /** * The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the WebApp. * If apiKeyId is not set during creation, then Firebase automatically associates an apiKeyId with the WebApp. * This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned. */ apiKeyId?: pulumi.Input<string | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * The user-assigned display name of the App. */ displayName: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; } //# sourceMappingURL=webApp.d.ts.map