1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firebase
  5. HostingSite
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.firebase.HostingSite

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

    Example Usage

    Firebasehosting Site Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.firebase.HostingSite("default", {
        project: "my-project-name",
        siteId: "site-no-app",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.firebase.HostingSite("default",
        project="my-project-name",
        site_id="site-no-app")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/firebase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
    			Project: pulumi.String("my-project-name"),
    			SiteId:  pulumi.String("site-no-app"),
    		})
    		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 @default = new Gcp.Firebase.HostingSite("default", new()
        {
            Project = "my-project-name",
            SiteId = "site-no-app",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.firebase.HostingSite;
    import com.pulumi.gcp.firebase.HostingSiteArgs;
    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 default_ = new HostingSite("default", HostingSiteArgs.builder()
                .project("my-project-name")
                .siteId("site-no-app")
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:firebase:HostingSite
        properties:
          project: my-project-name
          siteId: site-no-app
    

    Firebasehosting Site Full

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.firebase.WebApp("default", {
        project: "my-project-name",
        displayName: "Test web app for Firebase Hosting",
    });
    const full = new gcp.firebase.HostingSite("full", {
        project: "my-project-name",
        siteId: "site-with-app",
        appId: _default.appId,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.firebase.WebApp("default",
        project="my-project-name",
        display_name="Test web app for Firebase Hosting")
    full = gcp.firebase.HostingSite("full",
        project="my-project-name",
        site_id="site-with-app",
        app_id=default.app_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/firebase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := firebase.NewWebApp(ctx, "default", &firebase.WebAppArgs{
    			Project:     pulumi.String("my-project-name"),
    			DisplayName: pulumi.String("Test web app for Firebase Hosting"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = firebase.NewHostingSite(ctx, "full", &firebase.HostingSiteArgs{
    			Project: pulumi.String("my-project-name"),
    			SiteId:  pulumi.String("site-with-app"),
    			AppId:   _default.AppId,
    		})
    		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 @default = new Gcp.Firebase.WebApp("default", new()
        {
            Project = "my-project-name",
            DisplayName = "Test web app for Firebase Hosting",
        });
    
        var full = new Gcp.Firebase.HostingSite("full", new()
        {
            Project = "my-project-name",
            SiteId = "site-with-app",
            AppId = @default.AppId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.firebase.WebApp;
    import com.pulumi.gcp.firebase.WebAppArgs;
    import com.pulumi.gcp.firebase.HostingSite;
    import com.pulumi.gcp.firebase.HostingSiteArgs;
    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 default_ = new WebApp("default", WebAppArgs.builder()
                .project("my-project-name")
                .displayName("Test web app for Firebase Hosting")
                .build());
    
            var full = new HostingSite("full", HostingSiteArgs.builder()
                .project("my-project-name")
                .siteId("site-with-app")
                .appId(default_.appId())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:firebase:WebApp
        properties:
          project: my-project-name
          displayName: Test web app for Firebase Hosting
      full:
        type: gcp:firebase:HostingSite
        properties:
          project: my-project-name
          siteId: site-with-app
          appId: ${default.appId}
    

    Create HostingSite Resource

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

    Constructor syntax

    new HostingSite(name: string, args?: HostingSiteArgs, opts?: CustomResourceOptions);
    @overload
    def HostingSite(resource_name: str,
                    args: Optional[HostingSiteArgs] = None,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def HostingSite(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    app_id: Optional[str] = None,
                    project: Optional[str] = None,
                    site_id: Optional[str] = None)
    func NewHostingSite(ctx *Context, name string, args *HostingSiteArgs, opts ...ResourceOption) (*HostingSite, error)
    public HostingSite(string name, HostingSiteArgs? args = null, CustomResourceOptions? opts = null)
    public HostingSite(String name, HostingSiteArgs args)
    public HostingSite(String name, HostingSiteArgs args, CustomResourceOptions options)
    
    type: gcp:firebase:HostingSite
    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 HostingSiteArgs
    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 HostingSiteArgs
    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 HostingSiteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HostingSiteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HostingSiteArgs
    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 hostingSiteResource = new Gcp.Firebase.HostingSite("hostingSiteResource", new()
    {
        AppId = "string",
        Project = "string",
        SiteId = "string",
    });
    
    example, err := firebase.NewHostingSite(ctx, "hostingSiteResource", &firebase.HostingSiteArgs{
    	AppId:   pulumi.String("string"),
    	Project: pulumi.String("string"),
    	SiteId:  pulumi.String("string"),
    })
    
    var hostingSiteResource = new HostingSite("hostingSiteResource", HostingSiteArgs.builder()
        .appId("string")
        .project("string")
        .siteId("string")
        .build());
    
    hosting_site_resource = gcp.firebase.HostingSite("hostingSiteResource",
        app_id="string",
        project="string",
        site_id="string")
    
    const hostingSiteResource = new gcp.firebase.HostingSite("hostingSiteResource", {
        appId: "string",
        project: "string",
        siteId: "string",
    });
    
    type: gcp:firebase:HostingSite
    properties:
        appId: string
        project: string
        siteId: string
    

    HostingSite Resource Properties

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

    Inputs

    The HostingSite resource accepts the following input properties:

    AppId string
    Optional. The ID of a Web App associated with the Hosting site.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    SiteId string
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    AppId string
    Optional. The ID of a Web App associated with the Hosting site.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    SiteId string
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    appId String
    Optional. The ID of a Web App associated with the Hosting site.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    siteId String
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    appId string
    Optional. The ID of a Web App associated with the Hosting site.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    siteId string
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    app_id str
    Optional. The ID of a Web App associated with the Hosting site.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    site_id str
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    appId String
    Optional. The ID of a Web App associated with the Hosting site.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    siteId String
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.

    Outputs

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

    DefaultUrl string
    The default URL for the site in the form of https://{name}.web.app
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    DefaultUrl string
    The default URL for the site in the form of https://{name}.web.app
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    defaultUrl String
    The default URL for the site in the form of https://{name}.web.app
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    defaultUrl string
    The default URL for the site in the form of https://{name}.web.app
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    default_url str
    The default URL for the site in the form of https://{name}.web.app
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    defaultUrl String
    The default URL for the site in the form of https://{name}.web.app
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.

    Look up Existing HostingSite Resource

    Get an existing HostingSite 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?: HostingSiteState, opts?: CustomResourceOptions): HostingSite
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            default_url: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            site_id: Optional[str] = None) -> HostingSite
    func GetHostingSite(ctx *Context, name string, id IDInput, state *HostingSiteState, opts ...ResourceOption) (*HostingSite, error)
    public static HostingSite Get(string name, Input<string> id, HostingSiteState? state, CustomResourceOptions? opts = null)
    public static HostingSite get(String name, Output<String> id, HostingSiteState 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:
    AppId string
    Optional. The ID of a Web App associated with the Hosting site.
    DefaultUrl string
    The default URL for the site in the form of https://{name}.web.app
    Name string
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    SiteId string
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    AppId string
    Optional. The ID of a Web App associated with the Hosting site.
    DefaultUrl string
    The default URL for the site in the form of https://{name}.web.app
    Name string
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    SiteId string
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    appId String
    Optional. The ID of a Web App associated with the Hosting site.
    defaultUrl String
    The default URL for the site in the form of https://{name}.web.app
    name String
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    siteId String
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    appId string
    Optional. The ID of a Web App associated with the Hosting site.
    defaultUrl string
    The default URL for the site in the form of https://{name}.web.app
    name string
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    siteId string
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    app_id str
    Optional. The ID of a Web App associated with the Hosting site.
    default_url str
    The default URL for the site in the form of https://{name}.web.app
    name str
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    site_id str
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
    appId String
    Optional. The ID of a Web App associated with the Hosting site.
    defaultUrl String
    The default URL for the site in the form of https://{name}.web.app
    name String
    Output only. The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's ProjectNumber (recommended) or its ProjectId. Learn more about using project identifiers in Google's AIP 2510 standard.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    siteId String
    Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.

    Import

    Site can be imported using any of these accepted formats:

    • projects/{{project}}/sites/{{site_id}}

    • {{project}}/{{site_id}}

    • sites/{{site_id}}

    • {{site_id}}

    When using the pulumi import command, Site can be imported using one of the formats above. For example:

    $ pulumi import gcp:firebase/hostingSite:HostingSite default projects/{{project}}/sites/{{site_id}}
    
    $ pulumi import gcp:firebase/hostingSite:HostingSite default {{project}}/{{site_id}}
    
    $ pulumi import gcp:firebase/hostingSite:HostingSite default sites/{{site_id}}
    
    $ pulumi import gcp:firebase/hostingSite:HostingSite default {{site_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.3.1 published on Wednesday, Sep 25, 2024 by Pulumi