1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firebase
  5. WebApp
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.firebase.WebApp

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    A Google Cloud Firebase web application instance

    To get more information about WebApp, see:

    Example Usage

    Firebase Web App Custom Api Key

    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 pulumi
    import pulumi_gcp as gcp
    
    web = gcp.projects.ApiKey("web",
        project="my-project-name",
        name="api-key",
        display_name="Display Name",
        restrictions={
            "browser_key_restrictions": {
                "allowed_referrers": ["*"],
            },
        })
    default = gcp.firebase.WebApp("default",
        project="my-project-name",
        display_name="Display Name",
        api_key_id=web.uid,
        deletion_policy="DELETE")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/firebase"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		web, err := projects.NewApiKey(ctx, "web", &projects.ApiKeyArgs{
    			Project:     pulumi.String("my-project-name"),
    			Name:        pulumi.String("api-key"),
    			DisplayName: pulumi.String("Display Name"),
    			Restrictions: &projects.ApiKeyRestrictionsArgs{
    				BrowserKeyRestrictions: &projects.ApiKeyRestrictionsBrowserKeyRestrictionsArgs{
    					AllowedReferrers: pulumi.StringArray{
    						pulumi.String("*"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = firebase.NewWebApp(ctx, "default", &firebase.WebAppArgs{
    			Project:        pulumi.String("my-project-name"),
    			DisplayName:    pulumi.String("Display Name"),
    			ApiKeyId:       web.Uid,
    			DeletionPolicy: pulumi.String("DELETE"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var web = new Gcp.Projects.ApiKey("web", new()
        {
            Project = "my-project-name",
            Name = "api-key",
            DisplayName = "Display Name",
            Restrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsArgs
            {
                BrowserKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsBrowserKeyRestrictionsArgs
                {
                    AllowedReferrers = new[]
                    {
                        "*",
                    },
                },
            },
        });
    
        var @default = new Gcp.Firebase.WebApp("default", new()
        {
            Project = "my-project-name",
            DisplayName = "Display Name",
            ApiKeyId = web.Uid,
            DeletionPolicy = "DELETE",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.projects.ApiKey;
    import com.pulumi.gcp.projects.ApiKeyArgs;
    import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs;
    import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsBrowserKeyRestrictionsArgs;
    import com.pulumi.gcp.firebase.WebApp;
    import com.pulumi.gcp.firebase.WebAppArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var web = new ApiKey("web", ApiKeyArgs.builder()
                .project("my-project-name")
                .name("api-key")
                .displayName("Display Name")
                .restrictions(ApiKeyRestrictionsArgs.builder()
                    .browserKeyRestrictions(ApiKeyRestrictionsBrowserKeyRestrictionsArgs.builder()
                        .allowedReferrers("*")
                        .build())
                    .build())
                .build());
    
            var default_ = new WebApp("default", WebAppArgs.builder()
                .project("my-project-name")
                .displayName("Display Name")
                .apiKeyId(web.uid())
                .deletionPolicy("DELETE")
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:firebase:WebApp
        properties:
          project: my-project-name
          displayName: Display Name
          apiKeyId: ${web.uid}
          deletionPolicy: DELETE
      web:
        type: gcp:projects:ApiKey
        properties:
          project: my-project-name
          name: api-key
          displayName: Display Name
          restrictions:
            browserKeyRestrictions:
              allowedReferrers:
                - '*'
    

    Create WebApp Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new WebApp(name: string, args: WebAppArgs, opts?: CustomResourceOptions);
    @overload
    def WebApp(resource_name: str,
               args: WebAppArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def WebApp(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               display_name: Optional[str] = None,
               api_key_id: Optional[str] = None,
               deletion_policy: Optional[str] = None,
               project: Optional[str] = None)
    func NewWebApp(ctx *Context, name string, args WebAppArgs, opts ...ResourceOption) (*WebApp, error)
    public WebApp(string name, WebAppArgs args, CustomResourceOptions? opts = null)
    public WebApp(String name, WebAppArgs args)
    public WebApp(String name, WebAppArgs args, CustomResourceOptions options)
    
    type: gcp:firebase:WebApp
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args WebAppArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args WebAppArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args WebAppArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WebAppArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WebAppArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var webAppResource = new Gcp.Firebase.WebApp("webAppResource", new()
    {
        DisplayName = "string",
        ApiKeyId = "string",
        DeletionPolicy = "string",
        Project = "string",
    });
    
    example, err := firebase.NewWebApp(ctx, "webAppResource", &firebase.WebAppArgs{
    	DisplayName:    pulumi.String("string"),
    	ApiKeyId:       pulumi.String("string"),
    	DeletionPolicy: pulumi.String("string"),
    	Project:        pulumi.String("string"),
    })
    
    var webAppResource = new WebApp("webAppResource", WebAppArgs.builder()
        .displayName("string")
        .apiKeyId("string")
        .deletionPolicy("string")
        .project("string")
        .build());
    
    web_app_resource = gcp.firebase.WebApp("webAppResource",
        display_name="string",
        api_key_id="string",
        deletion_policy="string",
        project="string")
    
    const webAppResource = new gcp.firebase.WebApp("webAppResource", {
        displayName: "string",
        apiKeyId: "string",
        deletionPolicy: "string",
        project: "string",
    });
    
    type: gcp:firebase:WebApp
    properties:
        apiKeyId: string
        deletionPolicy: string
        displayName: string
        project: string
    

    WebApp Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The WebApp resource accepts the following input properties:

    DisplayName string
    The user-assigned display name of the App.


    ApiKeyId string
    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.
    DeletionPolicy string
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    DisplayName string
    The user-assigned display name of the App.


    ApiKeyId string
    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.
    DeletionPolicy string
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    displayName String
    The user-assigned display name of the App.


    apiKeyId String
    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.
    deletionPolicy String
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    displayName string
    The user-assigned display name of the App.


    apiKeyId string
    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.
    deletionPolicy string
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    display_name str
    The user-assigned display name of the App.


    api_key_id str
    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.
    deletion_policy str
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    displayName String
    The user-assigned display name of the App.


    apiKeyId String
    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.
    deletionPolicy String
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WebApp resource produces the following output properties:

    AppId 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.
    AppUrls List<string>
    The URLs where the WebApp is hosted.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    AppId 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.
    AppUrls []string
    The URLs where the WebApp is hosted.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    appId 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.
    appUrls List<String>
    The URLs where the WebApp is hosted.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    appId 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.
    appUrls string[]
    The URLs where the WebApp is hosted.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    app_id str
    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.
    app_urls Sequence[str]
    The URLs where the WebApp is hosted.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    appId 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.
    appUrls List<String>
    The URLs where the WebApp is hosted.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId

    Look up Existing WebApp Resource

    Get an existing WebApp resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: WebAppState, opts?: CustomResourceOptions): WebApp
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_key_id: Optional[str] = None,
            app_id: Optional[str] = None,
            app_urls: Optional[Sequence[str]] = None,
            deletion_policy: Optional[str] = None,
            display_name: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None) -> WebApp
    func GetWebApp(ctx *Context, name string, id IDInput, state *WebAppState, opts ...ResourceOption) (*WebApp, error)
    public static WebApp Get(string name, Input<string> id, WebAppState? state, CustomResourceOptions? opts = null)
    public static WebApp get(String name, Output<String> id, WebAppState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApiKeyId string
    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.
    AppId 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.
    AppUrls List<string>
    The URLs where the WebApp is hosted.
    DeletionPolicy string
    DisplayName string
    The user-assigned display name of the App.


    Name string
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ApiKeyId string
    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.
    AppId 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.
    AppUrls []string
    The URLs where the WebApp is hosted.
    DeletionPolicy string
    DisplayName string
    The user-assigned display name of the App.


    Name string
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    apiKeyId String
    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.
    appId 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.
    appUrls List<String>
    The URLs where the WebApp is hosted.
    deletionPolicy String
    displayName String
    The user-assigned display name of the App.


    name String
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    apiKeyId string
    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.
    appId 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.
    appUrls string[]
    The URLs where the WebApp is hosted.
    deletionPolicy string
    displayName string
    The user-assigned display name of the App.


    name string
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    api_key_id str
    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.
    app_id str
    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.
    app_urls Sequence[str]
    The URLs where the WebApp is hosted.
    deletion_policy str
    display_name str
    The user-assigned display name of the App.


    name str
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    apiKeyId String
    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.
    appId 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.
    appUrls List<String>
    The URLs where the WebApp is hosted.
    deletionPolicy String
    displayName String
    The user-assigned display name of the App.


    name String
    The fully qualified resource name of the App, for example: projects/projectId/webApps/appId
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    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:

    $ pulumi import gcp:firebase/webApp:WebApp 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}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi