» google_firebase_web_app

A Google Cloud Firebase web application instance

To get more information about WebApp, see:

» Example Usage - Firebase Web App Basic

resource "google_project" "default" {
    provider = google-beta

    project_id = "tf-test%{random_suffix}"
    name       = "tf-test%{random_suffix}"
    org_id     = "123456789"
}

resource "google_firebase_project" "default" {
    provider = google-beta
    project  = google_project.default.project_id
}

resource "google_firebase_web_app" "basic" {
    provider = google-beta
    project = google_project.default.project_id
    display_name = "Display Name Basic"

    depends_on = [google_firebase_project.default]
}

data "google_firebase_web_app_config" "basic" {
  provider   = google-beta
  web_app_id = google_firebase_web_app.basic.app_id
}

resource "google_storage_bucket" "default" {
    provider = google-beta
    name = "fb-webapp-"
}

resource "google_storage_bucket_object" "default" {
    provider = google-beta
    bucket = google_storage_bucket.default.name
    name = "firebase-config.json"

    content = jsonencode({
        appId              = google_firebase_web_app.basic.app_id
        apiKey             = data.google_firebase_web_app_config.basic.api_key
        authDomain         = data.google_firebase_web_app_config.basic.auth_domain
        databaseURL        = lookup(data.google_firebase_web_app_config.basic, "database_url", "")
        storageBucket      = lookup(data.google_firebase_web_app_config.basic, "storage_bucket", "")
        messagingSenderId  = lookup(data.google_firebase_web_app_config.basic, "messaging_sender_id", "")
        measurementId      = lookup(data.google_firebase_web_app_config.basic, "measurement_id", "")
    })
}

» Argument Reference

The following arguments are supported:

  • display_name - (Required) The user-assigned display name of the App.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

» Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format {{name}}

  • name - The fully qualified resource name of the App, for example: projects/projectId/webApps/appId

  • app_id - Immutable. 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.

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 10 minutes.
  • update - Default is 10 minutes.
  • delete - Default is 4 minutes.

» Import

WebApp can be imported using any of these accepted formats:

$ terraform import google_firebase_web_app.default {{name}}

» User Project Overrides

This resource supports User Project Overrides.