gcp.firebase.WebApp
A Google Cloud Firebase web application instance
To get more information about WebApp, see:
- API documentation
- How-to Guides
Example Usage
Firebase Web App Basic
using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var defaultProject = new Gcp.Organizations.Project("defaultProject", new()
{
ProjectId = "tf-test",
OrgId = "123456789",
Labels =
{
{ "firebase", "enabled" },
},
}, new CustomResourceOptions
{
Provider = google_beta,
});
var defaultFirebase_projectProject = new Gcp.Firebase.Project("defaultFirebase/projectProject", new()
{
ProjectID = defaultProject.ProjectId,
}, new CustomResourceOptions
{
Provider = google_beta,
});
var basicWebApp = new Gcp.Firebase.WebApp("basicWebApp", new()
{
Project = defaultProject.ProjectId,
DisplayName = "Display Name Basic",
DeletionPolicy = "DELETE",
}, new CustomResourceOptions
{
Provider = google_beta,
DependsOn = new[]
{
defaultFirebase / projectProject,
},
});
var basicWebAppConfig = Gcp.Firebase.GetWebAppConfig.Invoke(new()
{
WebAppId = basicWebApp.AppId,
});
var defaultBucket = new Gcp.Storage.Bucket("defaultBucket", new()
{
Location = "US",
}, new CustomResourceOptions
{
Provider = google_beta,
});
var defaultBucketObject = new Gcp.Storage.BucketObject("defaultBucketObject", new()
{
Bucket = defaultBucket.Name,
Content = Output.Tuple(basicWebApp.AppId, basicWebAppConfig, basicWebAppConfig, basicWebAppConfig["database_url"] ?? "", basicWebAppConfig["storage_bucket"] ?? "", basicWebAppConfig["messaging_sender_id"] ?? "", basicWebAppConfig["measurement_id"] ?? "").Apply(values =>
{
var appId = values.Item1;
var basicWebAppConfig = values.Item2;
var basicWebAppConfig1 = values.Item3;
var s = values.Item4;
var s1 = values.Item5;
var s2 = values.Item6;
var s3 = values.Item7;
return JsonSerializer.Serialize(new Dictionary<string, object?>
{
["appId"] = appId,
["apiKey"] = basicWebAppConfig.Apply(getWebAppConfigResult => getWebAppConfigResult.ApiKey),
["authDomain"] = basicWebAppConfig1.AuthDomain,
["databaseURL"] = s,
["storageBucket"] = s1,
["messagingSenderId"] = s2,
["measurementId"] = s3,
});
}),
}, new CustomResourceOptions
{
Provider = google_beta,
});
});
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Project;
import com.pulumi.gcp.organizations.ProjectArgs;
import com.pulumi.gcp.firebase.Project;
import com.pulumi.gcp.firebase.ProjectArgs;
import com.pulumi.gcp.firebase.WebApp;
import com.pulumi.gcp.firebase.WebAppArgs;
import com.pulumi.gcp.firebase.FirebaseFunctions;
import com.pulumi.gcp.firebase.inputs.GetWebAppConfigArgs;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.storage.BucketObject;
import com.pulumi.gcp.storage.BucketObjectArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import com.pulumi.resources.CustomResourceOptions;
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 defaultProject = new Project("defaultProject", ProjectArgs.builder()
.projectId("tf-test")
.orgId("123456789")
.labels(Map.of("firebase", "enabled"))
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var defaultFirebase_projectProject = new Project("defaultFirebase/projectProject", ProjectArgs.builder()
.project(defaultProject.projectId())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var basicWebApp = new WebApp("basicWebApp", WebAppArgs.builder()
.project(defaultProject.projectId())
.displayName("Display Name Basic")
.deletionPolicy("DELETE")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.dependsOn(defaultFirebase / projectProject)
.build());
final var basicWebAppConfig = FirebaseFunctions.getWebAppConfig(GetWebAppConfigArgs.builder()
.webAppId(basicWebApp.appId())
.build());
var defaultBucket = new Bucket("defaultBucket", BucketArgs.builder()
.location("US")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var defaultBucketObject = new BucketObject("defaultBucketObject", BucketObjectArgs.builder()
.bucket(defaultBucket.name())
.content(Output.tuple(basicWebApp.appId(), basicWebAppConfig.applyValue(getWebAppConfigResult -> getWebAppConfigResult), basicWebAppConfig.applyValue(getWebAppConfigResult -> getWebAppConfigResult), basicWebAppConfig.applyValue(getWebAppConfigResult -> getWebAppConfigResult)["database_url"], basicWebAppConfig.applyValue(getWebAppConfigResult -> getWebAppConfigResult)["storage_bucket"], basicWebAppConfig.applyValue(getWebAppConfigResult -> getWebAppConfigResult)["messaging_sender_id"], basicWebAppConfig.applyValue(getWebAppConfigResult -> getWebAppConfigResult)["measurement_id"]).applyValue(values -> {
var appId = values.t1;
var basicWebAppConfig = values.t2;
var basicWebAppConfig1 = values.t3;
var s = values.t4;
var s1 = values.t5;
var s2 = values.t6;
var s3 = values.t7;
return serializeJson(
jsonObject(
jsonProperty("appId", appId),
jsonProperty("apiKey", basicWebAppConfig.applyValue(getWebAppConfigResult -> getWebAppConfigResult.apiKey())),
jsonProperty("authDomain", basicWebAppConfig1.authDomain()),
jsonProperty("databaseURL", s),
jsonProperty("storageBucket", s1),
jsonProperty("messagingSenderId", s2),
jsonProperty("measurementId", s3)
));
}))
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
import pulumi
import json
import pulumi_gcp as gcp
default_project = gcp.organizations.Project("defaultProject",
project_id="tf-test",
org_id="123456789",
labels={
"firebase": "enabled",
},
opts=pulumi.ResourceOptions(provider=google_beta))
default_firebase_project_project = gcp.firebase.Project("defaultFirebase/projectProject", project=default_project.project_id,
opts=pulumi.ResourceOptions(provider=google_beta))
basic_web_app = gcp.firebase.WebApp("basicWebApp",
project=default_project.project_id,
display_name="Display Name Basic",
deletion_policy="DELETE",
opts=pulumi.ResourceOptions(provider=google_beta,
depends_on=[default_firebase / project_project]))
basic_web_app_config = gcp.firebase.get_web_app_config_output(web_app_id=basic_web_app.app_id)
default_bucket = gcp.storage.Bucket("defaultBucket", location="US",
opts=pulumi.ResourceOptions(provider=google_beta))
default_bucket_object = gcp.storage.BucketObject("defaultBucketObject",
bucket=default_bucket.name,
content=pulumi.Output.all(basic_web_app.app_id, basic_web_app_config, basic_web_app_config, (lambda v, def: v if v is not None else def)(basic_web_app_config["database_url"], ""), (lambda v, def: v if v is not None else def)(basic_web_app_config["storage_bucket"], ""), (lambda v, def: v if v is not None else def)(basic_web_app_config["messaging_sender_id"], ""), (lambda v, def: v if v is not None else def)(basic_web_app_config["measurement_id"], "")).apply(lambda app_id, basic_web_app_config, basic_web_app_config1, s, s1, s2, s3: json.dumps({
"appId": app_id,
"apiKey": basic_web_app_config.api_key,
"authDomain": basic_web_app_config1.auth_domain,
"databaseURL": s,
"storageBucket": s1,
"messagingSenderId": s2,
"measurementId": s3,
})),
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultProject = new gcp.organizations.Project("defaultProject", {
projectId: "tf-test",
orgId: "123456789",
labels: {
firebase: "enabled",
},
}, {
provider: google_beta,
});
const defaultFirebase_projectProject = new gcp.firebase.Project("defaultFirebase/projectProject", {project: defaultProject.projectId}, {
provider: google_beta,
});
const basicWebApp = new gcp.firebase.WebApp("basicWebApp", {
project: defaultProject.projectId,
displayName: "Display Name Basic",
deletionPolicy: "DELETE",
}, {
provider: google_beta,
dependsOn: [defaultFirebase / projectProject],
});
const basicWebAppConfig = gcp.firebase.getWebAppConfigOutput({
webAppId: basicWebApp.appId,
});
const defaultBucket = new gcp.storage.Bucket("defaultBucket", {location: "US"}, {
provider: google_beta,
});
const defaultBucketObject = new gcp.storage.BucketObject("defaultBucketObject", {
bucket: defaultBucket.name,
content: pulumi.all([basicWebApp.appId, basicWebAppConfig, basicWebAppConfig, basicWebAppConfig["database_url"] || "", basicWebAppConfig["storage_bucket"] || "", basicWebAppConfig["messaging_sender_id"] || "", basicWebAppConfig["measurement_id"] || ""]).apply(([appId, basicWebAppConfig, basicWebAppConfig1, s, s1, s2, s3]) => JSON.stringify({
appId: appId,
apiKey: basicWebAppConfig.apiKey,
authDomain: basicWebAppConfig1.authDomain,
databaseURL: s,
storageBucket: s1,
messagingSenderId: s2,
measurementId: s3,
})),
}, {
provider: google_beta,
});
Coming soon!
Create WebApp Resource
new WebApp(name: string, args: WebAppArgs, opts?: CustomResourceOptions);
@overload
def WebApp(resource_name: str,
opts: Optional[ResourceOptions] = None,
deletion_policy: Optional[str] = None,
display_name: Optional[str] = None,
project: Optional[str] = None)
@overload
def WebApp(resource_name: str,
args: WebAppArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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
The WebApp resource accepts the following input properties:
- Display
Name string The user-assigned display name of the App.
- Deletion
Policy string Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Display
Name string The user-assigned display name of the App.
- Deletion
Policy string Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String The user-assigned display name of the App.
- deletion
Policy String Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name string The user-assigned display name of the App.
- deletion
Policy string Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- 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.
- deletion_
policy str Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String The user-assigned display name of the App.
- deletion
Policy String Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- 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:
- App
Id 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.
- App
Urls 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
- App
Id 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.
- App
Urls []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 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.
- app
Urls 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
- app
Id 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.
- app
Urls 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
- app
Id 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.
- app
Urls 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,
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.
- App
Id 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.
- App
Urls List<string> The URLs where the
WebApp
is hosted.- Deletion
Policy string Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- Display
Name 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.
- App
Id 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.
- App
Urls []string The URLs where the
WebApp
is hosted.- Deletion
Policy string Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- Display
Name 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.
- app
Id 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.
- app
Urls List<String> The URLs where the
WebApp
is hosted.- deletion
Policy String Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- display
Name 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.
- app
Id 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.
- app
Urls string[] The URLs where the
WebApp
is hosted.- deletion
Policy string Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- display
Name 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.
- 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 Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- 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.
- app
Id 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.
- app
Urls List<String> The URLs where the
WebApp
is hosted.- deletion
Policy String Set to 'ABANDON' to allow the WebApp to be untracked from terraform state rather than deleted upon 'terraform destroy'. This is useful becaue the WebApp may be serving traffic. Set to 'DELETE' to delete the WebApp. Default to 'ABANDON'
- display
Name 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
$ pulumi import gcp:firebase/webApp:WebApp default {{project}}/{{name}}
$ pulumi import gcp:firebase/webApp:WebApp default {{project}} {{name}}
$ pulumi import gcp:firebase/webApp:WebApp default {{name}}
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.