GCP.FirebaseAppHosting reference
Backend
Section titled “Backend”Source:
src/GCP/FirebaseAppHosting/Backend.ts
A Firebase App Hosting backend — the primary resource that provisions a Cloud Run service and default domain for a web app.
Changing backendId, location, or servingLocality replaces the
backend. Display name, codebase, app id, environment, request logs,
service account, labels, and annotations update in place.
Backend: Creating a Backend
Section titled “Backend: Creating a Backend”Generated name
const backend = yield* GCP.FirebaseAppHosting.Backend("Web", { labels: { env: "test" },});Explicit id and regional serving
const backend = yield* GCP.FirebaseAppHosting.Backend("Web", { backendId: "web-prod", servingLocality: "REGIONAL_STRICT", serviceAccount: "firebase-app-hosting-compute@my-project.iam.gserviceaccount.com", displayName: "production web", labels: { env: "prod" },});Backend: Updating a Backend
Section titled “Backend: Updating a Backend”const backend = yield* GCP.FirebaseAppHosting.Backend("Web", { displayName: "production web v2", labels: { env: "prod", team: "web" },});BackendsBuild
Section titled “BackendsBuild”Source:
src/GCP/FirebaseAppHosting/BackendsBuild.ts
A Firebase App Hosting build of a backend from a git commit, storage archive, or container image.
Builds have no update API. Changing buildId, backend,
location, source, or config replaces the build.
BackendsBuild: Creating a Build
Section titled “BackendsBuild: Creating a Build”Container image
const build = yield* GCP.FirebaseAppHosting.BackendsBuild("Hello", { backend: backend.name, source: { container: { image: "us-docker.pkg.dev/cloudrun/container/hello" }, }, labels: { env: "test" },});Archive source with Cloud Run limits
const build = yield* GCP.FirebaseAppHosting.BackendsBuild("Archive", { backend: backend.name, source: { archive: { userStorageUri: "gs://bucket/app.tar.gz" } }, config: { runConfig: { cpu: 1, memoryMib: 512, maxInstances: 4 } },});BackendsDomain
Section titled “BackendsDomain”Source:
src/GCP/FirebaseAppHosting/BackendsDomain.ts
A domain name linked to a Firebase App Hosting backend. Default domains are created with the backend; this resource manages custom domains.
Changing domainId, backend, or location replaces the domain.
Serving behavior, display name, disabled, labels, and annotations
update in place.
BackendsDomain: Creating a Domain
Section titled “BackendsDomain: Creating a Domain”Custom domain
const domain = yield* GCP.FirebaseAppHosting.BackendsDomain("Www", { backend: backend.name, domainId: "www.example.com", labels: { env: "test" },});Redirect
const domain = yield* GCP.FirebaseAppHosting.BackendsDomain("Apex", { backend: backend.name, domainId: "example.com", serve: { redirect: { uri: "https://www.example.com", status: "301" } },});BackendsDomain: Updating a Domain
Section titled “BackendsDomain: Updating a Domain”const domain = yield* GCP.FirebaseAppHosting.BackendsDomain("Www", { domainId: "www.example.com", backend: backend.name, disabled: true, labels: { env: "prod" },});