published on Wednesday, Nov 18, 2026 by Pulumi
published on Wednesday, Nov 18, 2026 by Pulumi
Controls traffic configuration for a backend.
Example Usage
Firebase App Hosting Traffic Target
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
//## Include these blocks only once per project if you are starting from scratch ###
const serviceAccount = new gcp.serviceaccount.Account("service_account", {
project: "my-project-name",
accountId: "firebase-app-hosting-compute",
displayName: "Firebase App Hosting compute service account",
createIgnoreAlreadyExists: true,
});
const fah = new gcp.projects.Service("fah", {
project: "my-project-name",
service: "firebaseapphosting.googleapis.com",
});
const exampleAppHostingBackend = new gcp.firebase.AppHostingBackend("example", {
project: "my-project-name",
location: "asia-east1",
backendId: "traffic-tg",
appId: "1:0000000000:web:674cde32020e16fbce9dbd",
servingLocality: "GLOBAL_ACCESS",
serviceAccount: serviceAccount.email,
}, {
dependsOn: [fah],
});
const exampleAppHostingBuild = new gcp.firebase.AppHostingBuild("example", {
project: exampleAppHostingBackend.project,
location: exampleAppHostingBackend.location,
backend: exampleAppHostingBackend.backendId,
buildId: "target-build",
source: {
container: {
image: "us-docker.pkg.dev/cloudrun/container/hello",
},
},
});
const example = new gcp.firebase.AppHostingTraffic("example", {
project: exampleAppHostingBackend.project,
location: exampleAppHostingBackend.location,
backend: exampleAppHostingBackend.backendId,
target: {
splits: [{
build: exampleAppHostingBuild.name,
percent: 100,
}],
},
});
const appHostingSaRunner = new gcp.projects.IAMMember("app_hosting_sa_runner", {
project: "my-project-name",
role: "roles/firebaseapphosting.computeRunner",
member: serviceAccount.member,
});
import pulumi
import pulumi_gcp as gcp
### Include these blocks only once per project if you are starting from scratch ###
service_account = gcp.serviceaccount.Account("service_account",
project="my-project-name",
account_id="firebase-app-hosting-compute",
display_name="Firebase App Hosting compute service account",
create_ignore_already_exists=True)
fah = gcp.projects.Service("fah",
project="my-project-name",
service="firebaseapphosting.googleapis.com")
example_app_hosting_backend = gcp.firebase.AppHostingBackend("example",
project="my-project-name",
location="asia-east1",
backend_id="traffic-tg",
app_id="1:0000000000:web:674cde32020e16fbce9dbd",
serving_locality="GLOBAL_ACCESS",
service_account=service_account.email,
opts = pulumi.ResourceOptions(depends_on=[fah]))
example_app_hosting_build = gcp.firebase.AppHostingBuild("example",
project=example_app_hosting_backend.project,
location=example_app_hosting_backend.location,
backend=example_app_hosting_backend.backend_id,
build_id="target-build",
source={
"container": {
"image": "us-docker.pkg.dev/cloudrun/container/hello",
},
})
example = gcp.firebase.AppHostingTraffic("example",
project=example_app_hosting_backend.project,
location=example_app_hosting_backend.location,
backend=example_app_hosting_backend.backend_id,
target={
"splits": [{
"build": example_app_hosting_build.name,
"percent": 100,
}],
})
app_hosting_sa_runner = gcp.projects.IAMMember("app_hosting_sa_runner",
project="my-project-name",
role="roles/firebaseapphosting.computeRunner",
member=service_account.member)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/firebase"
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/projects"
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/serviceaccount"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
//## Include these blocks only once per project if you are starting from scratch ###
serviceAccount, err := serviceaccount.NewAccount(ctx, "service_account", &serviceaccount.AccountArgs{
Project: pulumi.String("my-project-name"),
AccountId: pulumi.String("firebase-app-hosting-compute"),
DisplayName: pulumi.String("Firebase App Hosting compute service account"),
CreateIgnoreAlreadyExists: pulumi.Bool(true),
})
if err != nil {
return err
}
fah, err := projects.NewService(ctx, "fah", &projects.ServiceArgs{
Project: pulumi.String("my-project-name"),
Service: pulumi.String("firebaseapphosting.googleapis.com"),
})
if err != nil {
return err
}
exampleAppHostingBackend, err := firebase.NewAppHostingBackend(ctx, "example", &firebase.AppHostingBackendArgs{
Project: pulumi.String("my-project-name"),
Location: pulumi.String("asia-east1"),
BackendId: pulumi.String("traffic-tg"),
AppId: pulumi.String("1:0000000000:web:674cde32020e16fbce9dbd"),
ServingLocality: pulumi.String("GLOBAL_ACCESS"),
ServiceAccount: serviceAccount.Email,
}, pulumi.DependsOn([]pulumi.Resource{
fah,
}))
if err != nil {
return err
}
exampleAppHostingBuild, err := firebase.NewAppHostingBuild(ctx, "example", &firebase.AppHostingBuildArgs{
Project: exampleAppHostingBackend.Project,
Location: exampleAppHostingBackend.Location,
Backend: exampleAppHostingBackend.BackendId,
BuildId: pulumi.String("target-build"),
Source: &firebase.AppHostingBuildSourceArgs{
Container: &firebase.AppHostingBuildSourceContainerArgs{
Image: pulumi.String("us-docker.pkg.dev/cloudrun/container/hello"),
},
},
})
if err != nil {
return err
}
_, err = firebase.NewAppHostingTraffic(ctx, "example", &firebase.AppHostingTrafficArgs{
Project: exampleAppHostingBackend.Project,
Location: exampleAppHostingBackend.Location,
Backend: exampleAppHostingBackend.BackendId,
Target: &firebase.AppHostingTrafficTargetArgs{
Splits: firebase.AppHostingTrafficTargetSplitArray{
&firebase.AppHostingTrafficTargetSplitArgs{
Build: exampleAppHostingBuild.Name,
Percent: pulumi.Int(100),
},
},
},
})
if err != nil {
return err
}
_, err = projects.NewIAMMember(ctx, "app_hosting_sa_runner", &projects.IAMMemberArgs{
Project: pulumi.String("my-project-name"),
Role: pulumi.String("roles/firebaseapphosting.computeRunner"),
Member: serviceAccount.Member,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
//## Include these blocks only once per project if you are starting from scratch ###
var serviceAccount = new Gcp.ServiceAccount.Account("service_account", new()
{
Project = "my-project-name",
AccountId = "firebase-app-hosting-compute",
DisplayName = "Firebase App Hosting compute service account",
CreateIgnoreAlreadyExists = true,
});
var fah = new Gcp.Projects.Service("fah", new()
{
Project = "my-project-name",
ServiceName = "firebaseapphosting.googleapis.com",
});
var exampleAppHostingBackend = new Gcp.Firebase.AppHostingBackend("example", new()
{
Project = "my-project-name",
Location = "asia-east1",
BackendId = "traffic-tg",
AppId = "1:0000000000:web:674cde32020e16fbce9dbd",
ServingLocality = "GLOBAL_ACCESS",
ServiceAccount = serviceAccount.Email,
}, new CustomResourceOptions
{
DependsOn =
{
fah,
},
});
var exampleAppHostingBuild = new Gcp.Firebase.AppHostingBuild("example", new()
{
Project = exampleAppHostingBackend.Project,
Location = exampleAppHostingBackend.Location,
Backend = exampleAppHostingBackend.BackendId,
BuildId = "target-build",
Source = new Gcp.Firebase.Inputs.AppHostingBuildSourceArgs
{
Container = new Gcp.Firebase.Inputs.AppHostingBuildSourceContainerArgs
{
Image = "us-docker.pkg.dev/cloudrun/container/hello",
},
},
});
var example = new Gcp.Firebase.AppHostingTraffic("example", new()
{
Project = exampleAppHostingBackend.Project,
Location = exampleAppHostingBackend.Location,
Backend = exampleAppHostingBackend.BackendId,
Target = new Gcp.Firebase.Inputs.AppHostingTrafficTargetArgs
{
Splits = new[]
{
new Gcp.Firebase.Inputs.AppHostingTrafficTargetSplitArgs
{
Build = exampleAppHostingBuild.Name,
Percent = 100,
},
},
},
});
var appHostingSaRunner = new Gcp.Projects.IAMMember("app_hosting_sa_runner", new()
{
Project = "my-project-name",
Role = "roles/firebaseapphosting.computeRunner",
Member = serviceAccount.Member,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceaccount.Account;
import com.pulumi.gcp.serviceaccount.AccountArgs;
import com.pulumi.gcp.projects.Service;
import com.pulumi.gcp.projects.ServiceArgs;
import com.pulumi.gcp.firebase.AppHostingBackend;
import com.pulumi.gcp.firebase.AppHostingBackendArgs;
import com.pulumi.gcp.firebase.AppHostingBuild;
import com.pulumi.gcp.firebase.AppHostingBuildArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingBuildSourceArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingBuildSourceContainerArgs;
import com.pulumi.gcp.firebase.AppHostingTraffic;
import com.pulumi.gcp.firebase.AppHostingTrafficArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingTrafficTargetArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingTrafficTargetSplitArgs;
import com.pulumi.gcp.projects.IAMMember;
import com.pulumi.gcp.projects.IAMMemberArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.ArrayList;
import java.util.Arrays;
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) {
//## Include these blocks only once per project if you are starting from scratch ###
var serviceAccount = new Account("serviceAccount", AccountArgs.builder()
.project("my-project-name")
.accountId("firebase-app-hosting-compute")
.displayName("Firebase App Hosting compute service account")
.createIgnoreAlreadyExists(true)
.build());
var fah = new Service("fah", ServiceArgs.builder()
.project("my-project-name")
.service("firebaseapphosting.googleapis.com")
.build());
var exampleAppHostingBackend = new AppHostingBackend("exampleAppHostingBackend", AppHostingBackendArgs.builder()
.project("my-project-name")
.location("asia-east1")
.backendId("traffic-tg")
.appId("1:0000000000:web:674cde32020e16fbce9dbd")
.servingLocality("GLOBAL_ACCESS")
.serviceAccount(serviceAccount.email())
.build(), CustomResourceOptions.builder()
.dependsOn(fah)
.build());
var exampleAppHostingBuild = new AppHostingBuild("exampleAppHostingBuild", AppHostingBuildArgs.builder()
.project(exampleAppHostingBackend.project())
.location(exampleAppHostingBackend.location())
.backend(exampleAppHostingBackend.backendId())
.buildId("target-build")
.source(AppHostingBuildSourceArgs.builder()
.container(AppHostingBuildSourceContainerArgs.builder()
.image("us-docker.pkg.dev/cloudrun/container/hello")
.build())
.build())
.build());
var example = new AppHostingTraffic("example", AppHostingTrafficArgs.builder()
.project(exampleAppHostingBackend.project())
.location(exampleAppHostingBackend.location())
.backend(exampleAppHostingBackend.backendId())
.target(AppHostingTrafficTargetArgs.builder()
.splits(AppHostingTrafficTargetSplitArgs.builder()
.build(exampleAppHostingBuild.name())
.percent(100)
.build())
.build())
.build());
var appHostingSaRunner = new IAMMember("appHostingSaRunner", IAMMemberArgs.builder()
.project("my-project-name")
.role("roles/firebaseapphosting.computeRunner")
.member(serviceAccount.member())
.build());
}
}
resources:
example:
type: gcp:firebase:AppHostingTraffic
properties:
project: ${exampleAppHostingBackend.project}
location: ${exampleAppHostingBackend.location}
backend: ${exampleAppHostingBackend.backendId}
target:
splits:
- build: ${exampleAppHostingBuild.name}
percent: 100
exampleAppHostingBuild:
type: gcp:firebase:AppHostingBuild
name: example
properties:
project: ${exampleAppHostingBackend.project}
location: ${exampleAppHostingBackend.location}
backend: ${exampleAppHostingBackend.backendId}
buildId: target-build
source:
container:
image: us-docker.pkg.dev/cloudrun/container/hello
exampleAppHostingBackend:
type: gcp:firebase:AppHostingBackend
name: example
properties:
project: my-project-name
location: asia-east1
backendId: traffic-tg
appId: 1:0000000000:web:674cde32020e16fbce9dbd
servingLocality: GLOBAL_ACCESS
serviceAccount: ${serviceAccount.email}
options:
dependsOn:
- ${fah}
### Include these blocks only once per project if you are starting from scratch ###
serviceAccount:
type: gcp:serviceaccount:Account
name: service_account
properties:
project: my-project-name
accountId: firebase-app-hosting-compute
displayName: Firebase App Hosting compute service account
createIgnoreAlreadyExists: true
appHostingSaRunner:
type: gcp:projects:IAMMember
name: app_hosting_sa_runner
properties:
project: my-project-name
role: roles/firebaseapphosting.computeRunner
member: ${serviceAccount.member}
fah:
type: gcp:projects:Service
properties:
project: my-project-name
service: firebaseapphosting.googleapis.com
terraform {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_firebase_app_hosting_traffic" "example" {
lifecycle {
create_before_destroy = true
}
project = gcp_firebase_app_hosting_backend.example.project
location = gcp_firebase_app_hosting_backend.example.location
backend = gcp_firebase_app_hosting_backend.example.backend_id
target = {
splits = [{
build = gcp_firebase_app_hosting_build.example.name
percent = 100
}]
}
}
resource "gcp_firebase_app_hosting_build" "example" {
lifecycle {
create_before_destroy = true
}
project = gcp_firebase_app_hosting_backend.example.project
location = gcp_firebase_app_hosting_backend.example.location
backend = gcp_firebase_app_hosting_backend.example.backend_id
build_id = "target-build"
source = {
container = {
image = "us-docker.pkg.dev/cloudrun/container/hello"
}
}
}
resource "gcp_firebase_app_hosting_backend" "example" {
depends_on = [gcp_projects_service.fah]
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
location = "asia-east1"
backend_id = "traffic-tg"
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
serving_locality = "GLOBAL_ACCESS"
service_account = gcp_serviceaccount_account.service_account.email
}
### Include these blocks only once per project if you are starting from scratch ###
resource "gcp_serviceaccount_account" "service_account" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
account_id = "firebase-app-hosting-compute"
display_name = "Firebase App Hosting compute service account"
create_ignore_already_exists = true
}
resource "gcp_projects_i_a_m_member" "app_hosting_sa_runner" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
role = "roles/firebaseapphosting.computeRunner"
member = gcp_serviceaccount_account.service_account.member
}
resource "gcp_projects_service" "fah" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
service = "firebaseapphosting.googleapis.com"
}
Firebase App Hosting Traffic Rollout Policy
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
//## Include these blocks only once per project if you are starting from scratch ###
const serviceAccount = new gcp.serviceaccount.Account("service_account", {
project: "my-project-name",
accountId: "firebase-app-hosting-compute",
displayName: "Firebase App Hosting compute service account",
createIgnoreAlreadyExists: true,
});
const fah = new gcp.projects.Service("fah", {
project: "my-project-name",
service: "firebaseapphosting.googleapis.com",
});
const exampleAppHostingBackend = new gcp.firebase.AppHostingBackend("example", {
project: "my-project-name",
location: "asia-east1",
backendId: "traffic-rp",
appId: "1:0000000000:web:674cde32020e16fbce9dbd",
servingLocality: "GLOBAL_ACCESS",
serviceAccount: serviceAccount.email,
}, {
dependsOn: [fah],
});
const example = new gcp.firebase.AppHostingTraffic("example", {
project: exampleAppHostingBackend.project,
location: exampleAppHostingBackend.location,
backend: exampleAppHostingBackend.backendId,
rolloutPolicy: {
codebaseBranch: "main",
},
});
const appHostingSaRunner = new gcp.projects.IAMMember("app_hosting_sa_runner", {
project: "my-project-name",
role: "roles/firebaseapphosting.computeRunner",
member: serviceAccount.member,
});
import pulumi
import pulumi_gcp as gcp
### Include these blocks only once per project if you are starting from scratch ###
service_account = gcp.serviceaccount.Account("service_account",
project="my-project-name",
account_id="firebase-app-hosting-compute",
display_name="Firebase App Hosting compute service account",
create_ignore_already_exists=True)
fah = gcp.projects.Service("fah",
project="my-project-name",
service="firebaseapphosting.googleapis.com")
example_app_hosting_backend = gcp.firebase.AppHostingBackend("example",
project="my-project-name",
location="asia-east1",
backend_id="traffic-rp",
app_id="1:0000000000:web:674cde32020e16fbce9dbd",
serving_locality="GLOBAL_ACCESS",
service_account=service_account.email,
opts = pulumi.ResourceOptions(depends_on=[fah]))
example = gcp.firebase.AppHostingTraffic("example",
project=example_app_hosting_backend.project,
location=example_app_hosting_backend.location,
backend=example_app_hosting_backend.backend_id,
rollout_policy={
"codebase_branch": "main",
})
app_hosting_sa_runner = gcp.projects.IAMMember("app_hosting_sa_runner",
project="my-project-name",
role="roles/firebaseapphosting.computeRunner",
member=service_account.member)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/firebase"
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/projects"
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/serviceaccount"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
//## Include these blocks only once per project if you are starting from scratch ###
serviceAccount, err := serviceaccount.NewAccount(ctx, "service_account", &serviceaccount.AccountArgs{
Project: pulumi.String("my-project-name"),
AccountId: pulumi.String("firebase-app-hosting-compute"),
DisplayName: pulumi.String("Firebase App Hosting compute service account"),
CreateIgnoreAlreadyExists: pulumi.Bool(true),
})
if err != nil {
return err
}
fah, err := projects.NewService(ctx, "fah", &projects.ServiceArgs{
Project: pulumi.String("my-project-name"),
Service: pulumi.String("firebaseapphosting.googleapis.com"),
})
if err != nil {
return err
}
exampleAppHostingBackend, err := firebase.NewAppHostingBackend(ctx, "example", &firebase.AppHostingBackendArgs{
Project: pulumi.String("my-project-name"),
Location: pulumi.String("asia-east1"),
BackendId: pulumi.String("traffic-rp"),
AppId: pulumi.String("1:0000000000:web:674cde32020e16fbce9dbd"),
ServingLocality: pulumi.String("GLOBAL_ACCESS"),
ServiceAccount: serviceAccount.Email,
}, pulumi.DependsOn([]pulumi.Resource{
fah,
}))
if err != nil {
return err
}
_, err = firebase.NewAppHostingTraffic(ctx, "example", &firebase.AppHostingTrafficArgs{
Project: exampleAppHostingBackend.Project,
Location: exampleAppHostingBackend.Location,
Backend: exampleAppHostingBackend.BackendId,
RolloutPolicy: &firebase.AppHostingTrafficRolloutPolicyArgs{
CodebaseBranch: pulumi.String("main"),
},
})
if err != nil {
return err
}
_, err = projects.NewIAMMember(ctx, "app_hosting_sa_runner", &projects.IAMMemberArgs{
Project: pulumi.String("my-project-name"),
Role: pulumi.String("roles/firebaseapphosting.computeRunner"),
Member: serviceAccount.Member,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
//## Include these blocks only once per project if you are starting from scratch ###
var serviceAccount = new Gcp.ServiceAccount.Account("service_account", new()
{
Project = "my-project-name",
AccountId = "firebase-app-hosting-compute",
DisplayName = "Firebase App Hosting compute service account",
CreateIgnoreAlreadyExists = true,
});
var fah = new Gcp.Projects.Service("fah", new()
{
Project = "my-project-name",
ServiceName = "firebaseapphosting.googleapis.com",
});
var exampleAppHostingBackend = new Gcp.Firebase.AppHostingBackend("example", new()
{
Project = "my-project-name",
Location = "asia-east1",
BackendId = "traffic-rp",
AppId = "1:0000000000:web:674cde32020e16fbce9dbd",
ServingLocality = "GLOBAL_ACCESS",
ServiceAccount = serviceAccount.Email,
}, new CustomResourceOptions
{
DependsOn =
{
fah,
},
});
var example = new Gcp.Firebase.AppHostingTraffic("example", new()
{
Project = exampleAppHostingBackend.Project,
Location = exampleAppHostingBackend.Location,
Backend = exampleAppHostingBackend.BackendId,
RolloutPolicy = new Gcp.Firebase.Inputs.AppHostingTrafficRolloutPolicyArgs
{
CodebaseBranch = "main",
},
});
var appHostingSaRunner = new Gcp.Projects.IAMMember("app_hosting_sa_runner", new()
{
Project = "my-project-name",
Role = "roles/firebaseapphosting.computeRunner",
Member = serviceAccount.Member,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceaccount.Account;
import com.pulumi.gcp.serviceaccount.AccountArgs;
import com.pulumi.gcp.projects.Service;
import com.pulumi.gcp.projects.ServiceArgs;
import com.pulumi.gcp.firebase.AppHostingBackend;
import com.pulumi.gcp.firebase.AppHostingBackendArgs;
import com.pulumi.gcp.firebase.AppHostingTraffic;
import com.pulumi.gcp.firebase.AppHostingTrafficArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingTrafficRolloutPolicyArgs;
import com.pulumi.gcp.projects.IAMMember;
import com.pulumi.gcp.projects.IAMMemberArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.ArrayList;
import java.util.Arrays;
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) {
//## Include these blocks only once per project if you are starting from scratch ###
var serviceAccount = new Account("serviceAccount", AccountArgs.builder()
.project("my-project-name")
.accountId("firebase-app-hosting-compute")
.displayName("Firebase App Hosting compute service account")
.createIgnoreAlreadyExists(true)
.build());
var fah = new Service("fah", ServiceArgs.builder()
.project("my-project-name")
.service("firebaseapphosting.googleapis.com")
.build());
var exampleAppHostingBackend = new AppHostingBackend("exampleAppHostingBackend", AppHostingBackendArgs.builder()
.project("my-project-name")
.location("asia-east1")
.backendId("traffic-rp")
.appId("1:0000000000:web:674cde32020e16fbce9dbd")
.servingLocality("GLOBAL_ACCESS")
.serviceAccount(serviceAccount.email())
.build(), CustomResourceOptions.builder()
.dependsOn(fah)
.build());
var example = new AppHostingTraffic("example", AppHostingTrafficArgs.builder()
.project(exampleAppHostingBackend.project())
.location(exampleAppHostingBackend.location())
.backend(exampleAppHostingBackend.backendId())
.rolloutPolicy(AppHostingTrafficRolloutPolicyArgs.builder()
.codebaseBranch("main")
.build())
.build());
var appHostingSaRunner = new IAMMember("appHostingSaRunner", IAMMemberArgs.builder()
.project("my-project-name")
.role("roles/firebaseapphosting.computeRunner")
.member(serviceAccount.member())
.build());
}
}
resources:
example:
type: gcp:firebase:AppHostingTraffic
properties:
project: ${exampleAppHostingBackend.project}
location: ${exampleAppHostingBackend.location}
backend: ${exampleAppHostingBackend.backendId}
rolloutPolicy:
codebaseBranch: main
exampleAppHostingBackend:
type: gcp:firebase:AppHostingBackend
name: example
properties:
project: my-project-name
location: asia-east1
backendId: traffic-rp
appId: 1:0000000000:web:674cde32020e16fbce9dbd
servingLocality: GLOBAL_ACCESS
serviceAccount: ${serviceAccount.email}
options:
dependsOn:
- ${fah}
### Include these blocks only once per project if you are starting from scratch ###
serviceAccount:
type: gcp:serviceaccount:Account
name: service_account
properties:
project: my-project-name
accountId: firebase-app-hosting-compute
displayName: Firebase App Hosting compute service account
createIgnoreAlreadyExists: true
appHostingSaRunner:
type: gcp:projects:IAMMember
name: app_hosting_sa_runner
properties:
project: my-project-name
role: roles/firebaseapphosting.computeRunner
member: ${serviceAccount.member}
fah:
type: gcp:projects:Service
properties:
project: my-project-name
service: firebaseapphosting.googleapis.com
terraform {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_firebase_app_hosting_traffic" "example" {
lifecycle {
create_before_destroy = true
}
project = gcp_firebase_app_hosting_backend.example.project
location = gcp_firebase_app_hosting_backend.example.location
backend = gcp_firebase_app_hosting_backend.example.backend_id
rollout_policy = {
codebase_branch = "main"
}
}
resource "gcp_firebase_app_hosting_backend" "example" {
depends_on = [gcp_projects_service.fah]
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
location = "asia-east1"
backend_id = "traffic-rp"
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
serving_locality = "GLOBAL_ACCESS"
service_account = gcp_serviceaccount_account.service_account.email
}
### Include these blocks only once per project if you are starting from scratch ###
resource "gcp_serviceaccount_account" "service_account" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
account_id = "firebase-app-hosting-compute"
display_name = "Firebase App Hosting compute service account"
create_ignore_already_exists = true
}
resource "gcp_projects_i_a_m_member" "app_hosting_sa_runner" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
role = "roles/firebaseapphosting.computeRunner"
member = gcp_serviceaccount_account.service_account.member
}
resource "gcp_projects_service" "fah" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
service = "firebaseapphosting.googleapis.com"
}
Firebase App Hosting Traffic Rollout Policy With Paths
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
//## Include these blocks only once per project if you are starting from scratch ###
const serviceAccount = new gcp.serviceaccount.Account("service_account", {
project: "my-project-name",
accountId: "firebase-app-hosting-compute",
displayName: "Firebase App Hosting compute service account",
createIgnoreAlreadyExists: true,
});
const appHostingSaRunner = new gcp.projects.IAMMember("app_hosting_sa_runner", {
project: "my-project-name",
role: "roles/firebaseapphosting.computeRunner",
member: serviceAccount.member,
});
const fah = new gcp.projects.Service("fah", {
project: "my-project-name",
service: "firebaseapphosting.googleapis.com",
});
const exampleAppHostingBackend = new gcp.firebase.AppHostingBackend("example", {
project: "my-project-name",
location: "us-central1",
backendId: "traffic-rpwp",
appId: "1:0000000000:web:674cde32020e16fbce9dbd",
servingLocality: "GLOBAL_ACCESS",
serviceAccount: serviceAccount.email,
}, {
dependsOn: [
fah,
appHostingSaRunner,
],
});
const example = new gcp.firebase.AppHostingTraffic("example", {
project: exampleAppHostingBackend.project,
location: exampleAppHostingBackend.location,
backend: exampleAppHostingBackend.backendId,
rolloutPolicy: {
codebaseBranch: "main",
requiredPaths: [{
pattern: "foo/bar/*",
type: "GLOB",
}],
ignoredPaths: [{
pattern: "foo/bar/excluded/*",
type: "GLOB",
}],
},
});
import pulumi
import pulumi_gcp as gcp
### Include these blocks only once per project if you are starting from scratch ###
service_account = gcp.serviceaccount.Account("service_account",
project="my-project-name",
account_id="firebase-app-hosting-compute",
display_name="Firebase App Hosting compute service account",
create_ignore_already_exists=True)
app_hosting_sa_runner = gcp.projects.IAMMember("app_hosting_sa_runner",
project="my-project-name",
role="roles/firebaseapphosting.computeRunner",
member=service_account.member)
fah = gcp.projects.Service("fah",
project="my-project-name",
service="firebaseapphosting.googleapis.com")
example_app_hosting_backend = gcp.firebase.AppHostingBackend("example",
project="my-project-name",
location="us-central1",
backend_id="traffic-rpwp",
app_id="1:0000000000:web:674cde32020e16fbce9dbd",
serving_locality="GLOBAL_ACCESS",
service_account=service_account.email,
opts = pulumi.ResourceOptions(depends_on=[
fah,
app_hosting_sa_runner,
]))
example = gcp.firebase.AppHostingTraffic("example",
project=example_app_hosting_backend.project,
location=example_app_hosting_backend.location,
backend=example_app_hosting_backend.backend_id,
rollout_policy={
"codebase_branch": "main",
"required_paths": [{
"pattern": "foo/bar/*",
"type": "GLOB",
}],
"ignored_paths": [{
"pattern": "foo/bar/excluded/*",
"type": "GLOB",
}],
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/firebase"
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/projects"
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/serviceaccount"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
//## Include these blocks only once per project if you are starting from scratch ###
serviceAccount, err := serviceaccount.NewAccount(ctx, "service_account", &serviceaccount.AccountArgs{
Project: pulumi.String("my-project-name"),
AccountId: pulumi.String("firebase-app-hosting-compute"),
DisplayName: pulumi.String("Firebase App Hosting compute service account"),
CreateIgnoreAlreadyExists: pulumi.Bool(true),
})
if err != nil {
return err
}
appHostingSaRunner, err := projects.NewIAMMember(ctx, "app_hosting_sa_runner", &projects.IAMMemberArgs{
Project: pulumi.String("my-project-name"),
Role: pulumi.String("roles/firebaseapphosting.computeRunner"),
Member: serviceAccount.Member,
})
if err != nil {
return err
}
fah, err := projects.NewService(ctx, "fah", &projects.ServiceArgs{
Project: pulumi.String("my-project-name"),
Service: pulumi.String("firebaseapphosting.googleapis.com"),
})
if err != nil {
return err
}
exampleAppHostingBackend, err := firebase.NewAppHostingBackend(ctx, "example", &firebase.AppHostingBackendArgs{
Project: pulumi.String("my-project-name"),
Location: pulumi.String("us-central1"),
BackendId: pulumi.String("traffic-rpwp"),
AppId: pulumi.String("1:0000000000:web:674cde32020e16fbce9dbd"),
ServingLocality: pulumi.String("GLOBAL_ACCESS"),
ServiceAccount: serviceAccount.Email,
}, pulumi.DependsOn([]pulumi.Resource{
fah,
appHostingSaRunner,
}))
if err != nil {
return err
}
_, err = firebase.NewAppHostingTraffic(ctx, "example", &firebase.AppHostingTrafficArgs{
Project: exampleAppHostingBackend.Project,
Location: exampleAppHostingBackend.Location,
Backend: exampleAppHostingBackend.BackendId,
RolloutPolicy: &firebase.AppHostingTrafficRolloutPolicyArgs{
CodebaseBranch: pulumi.String("main"),
RequiredPaths: firebase.AppHostingTrafficRolloutPolicyRequiredPathArray{
&firebase.AppHostingTrafficRolloutPolicyRequiredPathArgs{
Pattern: pulumi.String("foo/bar/*"),
Type: pulumi.String("GLOB"),
},
},
IgnoredPaths: firebase.AppHostingTrafficRolloutPolicyIgnoredPathArray{
&firebase.AppHostingTrafficRolloutPolicyIgnoredPathArgs{
Pattern: pulumi.String("foo/bar/excluded/*"),
Type: pulumi.String("GLOB"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
//## Include these blocks only once per project if you are starting from scratch ###
var serviceAccount = new Gcp.ServiceAccount.Account("service_account", new()
{
Project = "my-project-name",
AccountId = "firebase-app-hosting-compute",
DisplayName = "Firebase App Hosting compute service account",
CreateIgnoreAlreadyExists = true,
});
var appHostingSaRunner = new Gcp.Projects.IAMMember("app_hosting_sa_runner", new()
{
Project = "my-project-name",
Role = "roles/firebaseapphosting.computeRunner",
Member = serviceAccount.Member,
});
var fah = new Gcp.Projects.Service("fah", new()
{
Project = "my-project-name",
ServiceName = "firebaseapphosting.googleapis.com",
});
var exampleAppHostingBackend = new Gcp.Firebase.AppHostingBackend("example", new()
{
Project = "my-project-name",
Location = "us-central1",
BackendId = "traffic-rpwp",
AppId = "1:0000000000:web:674cde32020e16fbce9dbd",
ServingLocality = "GLOBAL_ACCESS",
ServiceAccount = serviceAccount.Email,
}, new CustomResourceOptions
{
DependsOn =
{
fah,
appHostingSaRunner,
},
});
var example = new Gcp.Firebase.AppHostingTraffic("example", new()
{
Project = exampleAppHostingBackend.Project,
Location = exampleAppHostingBackend.Location,
Backend = exampleAppHostingBackend.BackendId,
RolloutPolicy = new Gcp.Firebase.Inputs.AppHostingTrafficRolloutPolicyArgs
{
CodebaseBranch = "main",
RequiredPaths = new[]
{
new Gcp.Firebase.Inputs.AppHostingTrafficRolloutPolicyRequiredPathArgs
{
Pattern = "foo/bar/*",
Type = "GLOB",
},
},
IgnoredPaths = new[]
{
new Gcp.Firebase.Inputs.AppHostingTrafficRolloutPolicyIgnoredPathArgs
{
Pattern = "foo/bar/excluded/*",
Type = "GLOB",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceaccount.Account;
import com.pulumi.gcp.serviceaccount.AccountArgs;
import com.pulumi.gcp.projects.IAMMember;
import com.pulumi.gcp.projects.IAMMemberArgs;
import com.pulumi.gcp.projects.Service;
import com.pulumi.gcp.projects.ServiceArgs;
import com.pulumi.gcp.firebase.AppHostingBackend;
import com.pulumi.gcp.firebase.AppHostingBackendArgs;
import com.pulumi.gcp.firebase.AppHostingTraffic;
import com.pulumi.gcp.firebase.AppHostingTrafficArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingTrafficRolloutPolicyArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingTrafficRolloutPolicyRequiredPathArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingTrafficRolloutPolicyIgnoredPathArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.ArrayList;
import java.util.Arrays;
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) {
//## Include these blocks only once per project if you are starting from scratch ###
var serviceAccount = new Account("serviceAccount", AccountArgs.builder()
.project("my-project-name")
.accountId("firebase-app-hosting-compute")
.displayName("Firebase App Hosting compute service account")
.createIgnoreAlreadyExists(true)
.build());
var appHostingSaRunner = new IAMMember("appHostingSaRunner", IAMMemberArgs.builder()
.project("my-project-name")
.role("roles/firebaseapphosting.computeRunner")
.member(serviceAccount.member())
.build());
var fah = new Service("fah", ServiceArgs.builder()
.project("my-project-name")
.service("firebaseapphosting.googleapis.com")
.build());
var exampleAppHostingBackend = new AppHostingBackend("exampleAppHostingBackend", AppHostingBackendArgs.builder()
.project("my-project-name")
.location("us-central1")
.backendId("traffic-rpwp")
.appId("1:0000000000:web:674cde32020e16fbce9dbd")
.servingLocality("GLOBAL_ACCESS")
.serviceAccount(serviceAccount.email())
.build(), CustomResourceOptions.builder()
.dependsOn(
fah,
appHostingSaRunner)
.build());
var example = new AppHostingTraffic("example", AppHostingTrafficArgs.builder()
.project(exampleAppHostingBackend.project())
.location(exampleAppHostingBackend.location())
.backend(exampleAppHostingBackend.backendId())
.rolloutPolicy(AppHostingTrafficRolloutPolicyArgs.builder()
.codebaseBranch("main")
.requiredPaths(AppHostingTrafficRolloutPolicyRequiredPathArgs.builder()
.pattern("foo/bar/*")
.type("GLOB")
.build())
.ignoredPaths(AppHostingTrafficRolloutPolicyIgnoredPathArgs.builder()
.pattern("foo/bar/excluded/*")
.type("GLOB")
.build())
.build())
.build());
}
}
resources:
example:
type: gcp:firebase:AppHostingTraffic
properties:
project: ${exampleAppHostingBackend.project}
location: ${exampleAppHostingBackend.location}
backend: ${exampleAppHostingBackend.backendId}
rolloutPolicy:
codebaseBranch: main
requiredPaths:
- pattern: foo/bar/*
type: GLOB
ignoredPaths:
- pattern: foo/bar/excluded/*
type: GLOB
exampleAppHostingBackend:
type: gcp:firebase:AppHostingBackend
name: example
properties:
project: my-project-name
location: us-central1
backendId: traffic-rpwp
appId: 1:0000000000:web:674cde32020e16fbce9dbd
servingLocality: GLOBAL_ACCESS
serviceAccount: ${serviceAccount.email}
options:
dependsOn:
- ${fah}
- ${appHostingSaRunner}
### Include these blocks only once per project if you are starting from scratch ###
serviceAccount:
type: gcp:serviceaccount:Account
name: service_account
properties:
project: my-project-name
accountId: firebase-app-hosting-compute
displayName: Firebase App Hosting compute service account
createIgnoreAlreadyExists: true
appHostingSaRunner:
type: gcp:projects:IAMMember
name: app_hosting_sa_runner
properties:
project: my-project-name
role: roles/firebaseapphosting.computeRunner
member: ${serviceAccount.member}
fah:
type: gcp:projects:Service
properties:
project: my-project-name
service: firebaseapphosting.googleapis.com
terraform {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_firebase_app_hosting_traffic" "example" {
lifecycle {
create_before_destroy = true
}
project = gcp_firebase_app_hosting_backend.example.project
location = gcp_firebase_app_hosting_backend.example.location
backend = gcp_firebase_app_hosting_backend.example.backend_id
rollout_policy = {
codebase_branch = "main"
required_paths = [{
pattern = "foo/bar/*"
type = "GLOB"
}]
ignored_paths = [{
pattern = "foo/bar/excluded/*"
type = "GLOB"
}]
}
}
resource "gcp_firebase_app_hosting_backend" "example" {
depends_on = [gcp_projects_service.fah, gcp_projects_i_a_m_member.app_hosting_sa_runner]
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
location = "us-central1"
backend_id = "traffic-rpwp"
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
serving_locality = "GLOBAL_ACCESS"
service_account = gcp_serviceaccount_account.service_account.email
}
### Include these blocks only once per project if you are starting from scratch ###
resource "gcp_serviceaccount_account" "service_account" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
account_id = "firebase-app-hosting-compute"
display_name = "Firebase App Hosting compute service account"
create_ignore_already_exists = true
}
resource "gcp_projects_i_a_m_member" "app_hosting_sa_runner" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
role = "roles/firebaseapphosting.computeRunner"
member = gcp_serviceaccount_account.service_account.member
}
resource "gcp_projects_service" "fah" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
service = "firebaseapphosting.googleapis.com"
}
Firebase App Hosting Traffic Rollout Policy Disabled
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
//## Include these blocks only once per project if you are starting from scratch ###
const serviceAccount = new gcp.serviceaccount.Account("service_account", {
project: "my-project-name",
accountId: "firebase-app-hosting-compute",
displayName: "Firebase App Hosting compute service account",
createIgnoreAlreadyExists: true,
});
const fah = new gcp.projects.Service("fah", {
project: "my-project-name",
service: "firebaseapphosting.googleapis.com",
});
const exampleAppHostingBackend = new gcp.firebase.AppHostingBackend("example", {
project: "my-project-name",
location: "asia-east1",
backendId: "traffic-rpd",
appId: "1:0000000000:web:674cde32020e16fbce9dbd",
servingLocality: "GLOBAL_ACCESS",
serviceAccount: serviceAccount.email,
}, {
dependsOn: [fah],
});
const example = new gcp.firebase.AppHostingTraffic("example", {
project: exampleAppHostingBackend.project,
location: exampleAppHostingBackend.location,
backend: exampleAppHostingBackend.backendId,
rolloutPolicy: {
disabled: true,
codebaseBranch: "main",
},
});
const appHostingSaRunner = new gcp.projects.IAMMember("app_hosting_sa_runner", {
project: "my-project-name",
role: "roles/firebaseapphosting.computeRunner",
member: serviceAccount.member,
});
import pulumi
import pulumi_gcp as gcp
### Include these blocks only once per project if you are starting from scratch ###
service_account = gcp.serviceaccount.Account("service_account",
project="my-project-name",
account_id="firebase-app-hosting-compute",
display_name="Firebase App Hosting compute service account",
create_ignore_already_exists=True)
fah = gcp.projects.Service("fah",
project="my-project-name",
service="firebaseapphosting.googleapis.com")
example_app_hosting_backend = gcp.firebase.AppHostingBackend("example",
project="my-project-name",
location="asia-east1",
backend_id="traffic-rpd",
app_id="1:0000000000:web:674cde32020e16fbce9dbd",
serving_locality="GLOBAL_ACCESS",
service_account=service_account.email,
opts = pulumi.ResourceOptions(depends_on=[fah]))
example = gcp.firebase.AppHostingTraffic("example",
project=example_app_hosting_backend.project,
location=example_app_hosting_backend.location,
backend=example_app_hosting_backend.backend_id,
rollout_policy={
"disabled": True,
"codebase_branch": "main",
})
app_hosting_sa_runner = gcp.projects.IAMMember("app_hosting_sa_runner",
project="my-project-name",
role="roles/firebaseapphosting.computeRunner",
member=service_account.member)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/firebase"
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/projects"
"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/serviceaccount"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
//## Include these blocks only once per project if you are starting from scratch ###
serviceAccount, err := serviceaccount.NewAccount(ctx, "service_account", &serviceaccount.AccountArgs{
Project: pulumi.String("my-project-name"),
AccountId: pulumi.String("firebase-app-hosting-compute"),
DisplayName: pulumi.String("Firebase App Hosting compute service account"),
CreateIgnoreAlreadyExists: pulumi.Bool(true),
})
if err != nil {
return err
}
fah, err := projects.NewService(ctx, "fah", &projects.ServiceArgs{
Project: pulumi.String("my-project-name"),
Service: pulumi.String("firebaseapphosting.googleapis.com"),
})
if err != nil {
return err
}
exampleAppHostingBackend, err := firebase.NewAppHostingBackend(ctx, "example", &firebase.AppHostingBackendArgs{
Project: pulumi.String("my-project-name"),
Location: pulumi.String("asia-east1"),
BackendId: pulumi.String("traffic-rpd"),
AppId: pulumi.String("1:0000000000:web:674cde32020e16fbce9dbd"),
ServingLocality: pulumi.String("GLOBAL_ACCESS"),
ServiceAccount: serviceAccount.Email,
}, pulumi.DependsOn([]pulumi.Resource{
fah,
}))
if err != nil {
return err
}
_, err = firebase.NewAppHostingTraffic(ctx, "example", &firebase.AppHostingTrafficArgs{
Project: exampleAppHostingBackend.Project,
Location: exampleAppHostingBackend.Location,
Backend: exampleAppHostingBackend.BackendId,
RolloutPolicy: &firebase.AppHostingTrafficRolloutPolicyArgs{
Disabled: pulumi.Bool(true),
CodebaseBranch: pulumi.String("main"),
},
})
if err != nil {
return err
}
_, err = projects.NewIAMMember(ctx, "app_hosting_sa_runner", &projects.IAMMemberArgs{
Project: pulumi.String("my-project-name"),
Role: pulumi.String("roles/firebaseapphosting.computeRunner"),
Member: serviceAccount.Member,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
//## Include these blocks only once per project if you are starting from scratch ###
var serviceAccount = new Gcp.ServiceAccount.Account("service_account", new()
{
Project = "my-project-name",
AccountId = "firebase-app-hosting-compute",
DisplayName = "Firebase App Hosting compute service account",
CreateIgnoreAlreadyExists = true,
});
var fah = new Gcp.Projects.Service("fah", new()
{
Project = "my-project-name",
ServiceName = "firebaseapphosting.googleapis.com",
});
var exampleAppHostingBackend = new Gcp.Firebase.AppHostingBackend("example", new()
{
Project = "my-project-name",
Location = "asia-east1",
BackendId = "traffic-rpd",
AppId = "1:0000000000:web:674cde32020e16fbce9dbd",
ServingLocality = "GLOBAL_ACCESS",
ServiceAccount = serviceAccount.Email,
}, new CustomResourceOptions
{
DependsOn =
{
fah,
},
});
var example = new Gcp.Firebase.AppHostingTraffic("example", new()
{
Project = exampleAppHostingBackend.Project,
Location = exampleAppHostingBackend.Location,
Backend = exampleAppHostingBackend.BackendId,
RolloutPolicy = new Gcp.Firebase.Inputs.AppHostingTrafficRolloutPolicyArgs
{
Disabled = true,
CodebaseBranch = "main",
},
});
var appHostingSaRunner = new Gcp.Projects.IAMMember("app_hosting_sa_runner", new()
{
Project = "my-project-name",
Role = "roles/firebaseapphosting.computeRunner",
Member = serviceAccount.Member,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceaccount.Account;
import com.pulumi.gcp.serviceaccount.AccountArgs;
import com.pulumi.gcp.projects.Service;
import com.pulumi.gcp.projects.ServiceArgs;
import com.pulumi.gcp.firebase.AppHostingBackend;
import com.pulumi.gcp.firebase.AppHostingBackendArgs;
import com.pulumi.gcp.firebase.AppHostingTraffic;
import com.pulumi.gcp.firebase.AppHostingTrafficArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingTrafficRolloutPolicyArgs;
import com.pulumi.gcp.projects.IAMMember;
import com.pulumi.gcp.projects.IAMMemberArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.ArrayList;
import java.util.Arrays;
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) {
//## Include these blocks only once per project if you are starting from scratch ###
var serviceAccount = new Account("serviceAccount", AccountArgs.builder()
.project("my-project-name")
.accountId("firebase-app-hosting-compute")
.displayName("Firebase App Hosting compute service account")
.createIgnoreAlreadyExists(true)
.build());
var fah = new Service("fah", ServiceArgs.builder()
.project("my-project-name")
.service("firebaseapphosting.googleapis.com")
.build());
var exampleAppHostingBackend = new AppHostingBackend("exampleAppHostingBackend", AppHostingBackendArgs.builder()
.project("my-project-name")
.location("asia-east1")
.backendId("traffic-rpd")
.appId("1:0000000000:web:674cde32020e16fbce9dbd")
.servingLocality("GLOBAL_ACCESS")
.serviceAccount(serviceAccount.email())
.build(), CustomResourceOptions.builder()
.dependsOn(fah)
.build());
var example = new AppHostingTraffic("example", AppHostingTrafficArgs.builder()
.project(exampleAppHostingBackend.project())
.location(exampleAppHostingBackend.location())
.backend(exampleAppHostingBackend.backendId())
.rolloutPolicy(AppHostingTrafficRolloutPolicyArgs.builder()
.disabled(true)
.codebaseBranch("main")
.build())
.build());
var appHostingSaRunner = new IAMMember("appHostingSaRunner", IAMMemberArgs.builder()
.project("my-project-name")
.role("roles/firebaseapphosting.computeRunner")
.member(serviceAccount.member())
.build());
}
}
resources:
example:
type: gcp:firebase:AppHostingTraffic
properties:
project: ${exampleAppHostingBackend.project}
location: ${exampleAppHostingBackend.location}
backend: ${exampleAppHostingBackend.backendId}
rolloutPolicy:
disabled: true
codebaseBranch: main
exampleAppHostingBackend:
type: gcp:firebase:AppHostingBackend
name: example
properties:
project: my-project-name
location: asia-east1
backendId: traffic-rpd
appId: 1:0000000000:web:674cde32020e16fbce9dbd
servingLocality: GLOBAL_ACCESS
serviceAccount: ${serviceAccount.email}
options:
dependsOn:
- ${fah}
### Include these blocks only once per project if you are starting from scratch ###
serviceAccount:
type: gcp:serviceaccount:Account
name: service_account
properties:
project: my-project-name
accountId: firebase-app-hosting-compute
displayName: Firebase App Hosting compute service account
createIgnoreAlreadyExists: true
appHostingSaRunner:
type: gcp:projects:IAMMember
name: app_hosting_sa_runner
properties:
project: my-project-name
role: roles/firebaseapphosting.computeRunner
member: ${serviceAccount.member}
fah:
type: gcp:projects:Service
properties:
project: my-project-name
service: firebaseapphosting.googleapis.com
terraform {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_firebase_app_hosting_traffic" "example" {
lifecycle {
create_before_destroy = true
}
project = gcp_firebase_app_hosting_backend.example.project
location = gcp_firebase_app_hosting_backend.example.location
backend = gcp_firebase_app_hosting_backend.example.backend_id
rollout_policy = {
disabled = true
codebase_branch = "main"
}
}
resource "gcp_firebase_app_hosting_backend" "example" {
depends_on = [gcp_projects_service.fah]
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
location = "asia-east1"
backend_id = "traffic-rpd"
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
serving_locality = "GLOBAL_ACCESS"
service_account = gcp_serviceaccount_account.service_account.email
}
### Include these blocks only once per project if you are starting from scratch ###
resource "gcp_serviceaccount_account" "service_account" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
account_id = "firebase-app-hosting-compute"
display_name = "Firebase App Hosting compute service account"
create_ignore_already_exists = true
}
resource "gcp_projects_i_a_m_member" "app_hosting_sa_runner" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
role = "roles/firebaseapphosting.computeRunner"
member = gcp_serviceaccount_account.service_account.member
}
resource "gcp_projects_service" "fah" {
lifecycle {
create_before_destroy = true
}
project = "my-project-name"
service = "firebaseapphosting.googleapis.com"
}
Create AppHostingTraffic Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AppHostingTraffic(name: string, args: AppHostingTrafficArgs, opts?: CustomResourceOptions);@overload
def AppHostingTraffic(resource_name: str,
args: AppHostingTrafficArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AppHostingTraffic(resource_name: str,
opts: Optional[ResourceOptions] = None,
backend: Optional[str] = None,
location: Optional[str] = None,
project: Optional[str] = None,
rollout_policy: Optional[AppHostingTrafficRolloutPolicyArgs] = None,
target: Optional[AppHostingTrafficTargetArgs] = None)func NewAppHostingTraffic(ctx *Context, name string, args AppHostingTrafficArgs, opts ...ResourceOption) (*AppHostingTraffic, error)public AppHostingTraffic(string name, AppHostingTrafficArgs args, CustomResourceOptions? opts = null)
public AppHostingTraffic(String name, AppHostingTrafficArgs args)
public AppHostingTraffic(String name, AppHostingTrafficArgs args, CustomResourceOptions options)
type: gcp:firebase:AppHostingTraffic
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "gcp_firebase_app_hosting_traffic" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args AppHostingTrafficArgs
- 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 AppHostingTrafficArgs
- 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 AppHostingTrafficArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppHostingTrafficArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AppHostingTrafficArgs
- 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 appHostingTrafficResource = new Gcp.Firebase.AppHostingTraffic("appHostingTrafficResource", new()
{
Backend = "string",
Location = "string",
Project = "string",
RolloutPolicy = new Gcp.Firebase.Inputs.AppHostingTrafficRolloutPolicyArgs
{
CodebaseBranch = "string",
Disabled = false,
DisabledTime = "string",
IgnoredPaths = new[]
{
new Gcp.Firebase.Inputs.AppHostingTrafficRolloutPolicyIgnoredPathArgs
{
Pattern = "string",
Type = "string",
},
},
RequiredPaths = new[]
{
new Gcp.Firebase.Inputs.AppHostingTrafficRolloutPolicyRequiredPathArgs
{
Pattern = "string",
Type = "string",
},
},
},
Target = new Gcp.Firebase.Inputs.AppHostingTrafficTargetArgs
{
Splits = new[]
{
new Gcp.Firebase.Inputs.AppHostingTrafficTargetSplitArgs
{
Build = "string",
Percent = 0,
},
},
},
});
example, err := firebase.NewAppHostingTraffic(ctx, "appHostingTrafficResource", &firebase.AppHostingTrafficArgs{
Backend: pulumi.String("string"),
Location: pulumi.String("string"),
Project: pulumi.String("string"),
RolloutPolicy: &firebase.AppHostingTrafficRolloutPolicyArgs{
CodebaseBranch: pulumi.String("string"),
Disabled: pulumi.Bool(false),
DisabledTime: pulumi.String("string"),
IgnoredPaths: firebase.AppHostingTrafficRolloutPolicyIgnoredPathArray{
&firebase.AppHostingTrafficRolloutPolicyIgnoredPathArgs{
Pattern: pulumi.String("string"),
Type: pulumi.String("string"),
},
},
RequiredPaths: firebase.AppHostingTrafficRolloutPolicyRequiredPathArray{
&firebase.AppHostingTrafficRolloutPolicyRequiredPathArgs{
Pattern: pulumi.String("string"),
Type: pulumi.String("string"),
},
},
},
Target: &firebase.AppHostingTrafficTargetArgs{
Splits: firebase.AppHostingTrafficTargetSplitArray{
&firebase.AppHostingTrafficTargetSplitArgs{
Build: pulumi.String("string"),
Percent: pulumi.Int(0),
},
},
},
})
resource "gcp_firebase_app_hosting_traffic" "appHostingTrafficResource" {
lifecycle {
create_before_destroy = true
}
backend = "string"
location = "string"
project = "string"
rollout_policy = {
codebase_branch = "string"
disabled = false
disabled_time = "string"
ignored_paths = [{
pattern = "string"
type = "string"
}]
required_paths = [{
pattern = "string"
type = "string"
}]
}
target = {
splits = [{
build = "string"
percent = 0
}]
}
}
var appHostingTrafficResource = new AppHostingTraffic("appHostingTrafficResource", AppHostingTrafficArgs.builder()
.backend("string")
.location("string")
.project("string")
.rolloutPolicy(AppHostingTrafficRolloutPolicyArgs.builder()
.codebaseBranch("string")
.disabled(false)
.disabledTime("string")
.ignoredPaths(AppHostingTrafficRolloutPolicyIgnoredPathArgs.builder()
.pattern("string")
.type("string")
.build())
.requiredPaths(AppHostingTrafficRolloutPolicyRequiredPathArgs.builder()
.pattern("string")
.type("string")
.build())
.build())
.target(AppHostingTrafficTargetArgs.builder()
.splits(AppHostingTrafficTargetSplitArgs.builder()
.build("string")
.percent(0)
.build())
.build())
.build());
app_hosting_traffic_resource = gcp.firebase.AppHostingTraffic("appHostingTrafficResource",
backend="string",
location="string",
project="string",
rollout_policy={
"codebase_branch": "string",
"disabled": False,
"disabled_time": "string",
"ignored_paths": [{
"pattern": "string",
"type": "string",
}],
"required_paths": [{
"pattern": "string",
"type": "string",
}],
},
target={
"splits": [{
"build": "string",
"percent": 0,
}],
})
const appHostingTrafficResource = new gcp.firebase.AppHostingTraffic("appHostingTrafficResource", {
backend: "string",
location: "string",
project: "string",
rolloutPolicy: {
codebaseBranch: "string",
disabled: false,
disabledTime: "string",
ignoredPaths: [{
pattern: "string",
type: "string",
}],
requiredPaths: [{
pattern: "string",
type: "string",
}],
},
target: {
splits: [{
build: "string",
percent: 0,
}],
},
});
type: gcp:firebase:AppHostingTraffic
properties:
backend: string
location: string
project: string
rolloutPolicy:
codebaseBranch: string
disabled: false
disabledTime: string
ignoredPaths:
- pattern: string
type: string
requiredPaths:
- pattern: string
type: string
target:
splits:
- build: string
percent: 0
AppHostingTraffic 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 AppHostingTraffic resource accepts the following input properties:
- Backend string
- Id of the backend that this Traffic config applies to
- Location string
- The location the Backend that this Traffic config applies to
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Rollout
Policy AppHosting Traffic Rollout Policy - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- Target
App
Hosting Traffic Target - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- Backend string
- Id of the backend that this Traffic config applies to
- Location string
- The location the Backend that this Traffic config applies to
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Rollout
Policy AppHosting Traffic Rollout Policy Args - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- Target
App
Hosting Traffic Target Args - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- backend string
- Id of the backend that this Traffic config applies to
- location string
- The location the Backend that this Traffic config applies to
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout_
policy object - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target object
- Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- backend String
- Id of the backend that this Traffic config applies to
- location String
- The location the Backend that this Traffic config applies to
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout
Policy AppHosting Traffic Rollout Policy - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target
App
Hosting Traffic Target - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- backend string
- Id of the backend that this Traffic config applies to
- location string
- The location the Backend that this Traffic config applies to
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout
Policy AppHosting Traffic Rollout Policy - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target
App
Hosting Traffic Target - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- backend str
- Id of the backend that this Traffic config applies to
- location str
- The location the Backend that this Traffic config applies to
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout_
policy AppHosting Traffic Rollout Policy Args - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target
App
Hosting Traffic Target Args - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- backend String
- Id of the backend that this Traffic config applies to
- location String
- The location the Backend that this Traffic config applies to
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout
Policy Property Map - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target Property Map
- Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the AppHostingTraffic resource produces the following output properties:
- Create
Time string - Time at which the backend was created.
- Currents
List<App
Hosting Traffic Current> - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - Delete
Time string - Time at which the backend was deleted.
- Etag string
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - Uid string
- System-assigned, unique identifier.
- Update
Time string - Time at which the backend was last updated.
- Create
Time string - Time at which the backend was created.
- Currents
[]App
Hosting Traffic Current - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - Delete
Time string - Time at which the backend was deleted.
- Etag string
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - Uid string
- System-assigned, unique identifier.
- Update
Time string - Time at which the backend was last updated.
- create_
time string - Time at which the backend was created.
- currents list(object)
- Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete_
time string - Time at which the backend was deleted.
- etag string
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - uid string
- System-assigned, unique identifier.
- update_
time string - Time at which the backend was last updated.
- create
Time String - Time at which the backend was created.
- currents
List<App
Hosting Traffic Current> - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete
Time String - Time at which the backend was deleted.
- etag String
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - uid String
- System-assigned, unique identifier.
- update
Time String - Time at which the backend was last updated.
- create
Time string - Time at which the backend was created.
- currents
App
Hosting Traffic Current[] - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete
Time string - Time at which the backend was deleted.
- etag string
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - uid string
- System-assigned, unique identifier.
- update
Time string - Time at which the backend was last updated.
- create_
time str - Time at which the backend was created.
- currents
Sequence[App
Hosting Traffic Current] - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete_
time str - Time at which the backend was deleted.
- etag str
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - uid str
- System-assigned, unique identifier.
- update_
time str - Time at which the backend was last updated.
- create
Time String - Time at which the backend was created.
- currents List<Property Map>
- Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete
Time String - Time at which the backend was deleted.
- etag String
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - uid String
- System-assigned, unique identifier.
- update
Time String - Time at which the backend was last updated.
Look up Existing AppHostingTraffic Resource
Get an existing AppHostingTraffic 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?: AppHostingTrafficState, opts?: CustomResourceOptions): AppHostingTraffic@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backend: Optional[str] = None,
create_time: Optional[str] = None,
currents: Optional[Sequence[AppHostingTrafficCurrentArgs]] = None,
delete_time: Optional[str] = None,
etag: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
rollout_policy: Optional[AppHostingTrafficRolloutPolicyArgs] = None,
target: Optional[AppHostingTrafficTargetArgs] = None,
uid: Optional[str] = None,
update_time: Optional[str] = None) -> AppHostingTrafficfunc GetAppHostingTraffic(ctx *Context, name string, id IDInput, state *AppHostingTrafficState, opts ...ResourceOption) (*AppHostingTraffic, error)public static AppHostingTraffic Get(string name, Input<string> id, AppHostingTrafficState? state, CustomResourceOptions? opts = null)public static AppHostingTraffic get(String name, Output<String> id, AppHostingTrafficState state, CustomResourceOptions options)resources: existingAppHostingTraffic: type: gcp:firebase:AppHostingTraffic get: id: ${id}import {
to = gcp_firebase_app_hosting_traffic.example
id = "${id}"
}
- name string
- The unique name of the resulting resource.
- id Input<ID>
- The unique provider ID of the resource to look up.
- state AppHostingTrafficState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resulting resource.
- id str
- The unique provider ID of the resource to look up.
- 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 resulting resource.
- id IDInput
- The unique provider ID of the resource to look up.
- state AppHostingTrafficState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resulting resource.
- id Input<string>
- The unique provider ID of the resource to look up.
- state AppHostingTrafficState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resulting resource.
- id Output<String>
- The unique provider ID of the resource to look up.
- state AppHostingTrafficState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
- Backend string
- Id of the backend that this Traffic config applies to
- Create
Time string - Time at which the backend was created.
- Currents
List<App
Hosting Traffic Current> - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - Delete
Time string - Time at which the backend was deleted.
- Etag string
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- Location string
- The location the Backend that this Traffic config applies to
- Name string
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Rollout
Policy AppHosting Traffic Rollout Policy - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- Target
App
Hosting Traffic Target - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- Uid string
- System-assigned, unique identifier.
- Update
Time string - Time at which the backend was last updated.
- Backend string
- Id of the backend that this Traffic config applies to
- Create
Time string - Time at which the backend was created.
- Currents
[]App
Hosting Traffic Current Args - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - Delete
Time string - Time at which the backend was deleted.
- Etag string
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- Location string
- The location the Backend that this Traffic config applies to
- Name string
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Rollout
Policy AppHosting Traffic Rollout Policy Args - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- Target
App
Hosting Traffic Target Args - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- Uid string
- System-assigned, unique identifier.
- Update
Time string - Time at which the backend was last updated.
- backend string
- Id of the backend that this Traffic config applies to
- create_
time string - Time at which the backend was created.
- currents list(object)
- Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete_
time string - Time at which the backend was deleted.
- etag string
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- location string
- The location the Backend that this Traffic config applies to
- name string
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout_
policy object - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target object
- Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- uid string
- System-assigned, unique identifier.
- update_
time string - Time at which the backend was last updated.
- backend String
- Id of the backend that this Traffic config applies to
- create
Time String - Time at which the backend was created.
- currents
List<App
Hosting Traffic Current> - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete
Time String - Time at which the backend was deleted.
- etag String
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- location String
- The location the Backend that this Traffic config applies to
- name String
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout
Policy AppHosting Traffic Rollout Policy - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target
App
Hosting Traffic Target - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- uid String
- System-assigned, unique identifier.
- update
Time String - Time at which the backend was last updated.
- backend string
- Id of the backend that this Traffic config applies to
- create
Time string - Time at which the backend was created.
- currents
App
Hosting Traffic Current[] - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete
Time string - Time at which the backend was deleted.
- etag string
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- location string
- The location the Backend that this Traffic config applies to
- name string
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout
Policy AppHosting Traffic Rollout Policy - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target
App
Hosting Traffic Target - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- uid string
- System-assigned, unique identifier.
- update
Time string - Time at which the backend was last updated.
- backend str
- Id of the backend that this Traffic config applies to
- create_
time str - Time at which the backend was created.
- currents
Sequence[App
Hosting Traffic Current Args] - Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete_
time str - Time at which the backend was deleted.
- etag str
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- location str
- The location the Backend that this Traffic config applies to
- name str
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout_
policy AppHosting Traffic Rollout Policy Args - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target
App
Hosting Traffic Target Args - Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- uid str
- System-assigned, unique identifier.
- update_
time str - Time at which the backend was last updated.
- backend String
- Id of the backend that this Traffic config applies to
- create
Time String - Time at which the backend was created.
- currents List<Property Map>
- Current state of traffic allocation for the backend.
When setting
target, this field may differ for some time until the desired state is reached. Structure is documented below. - delete
Time String - Time at which the backend was deleted.
- etag String
- Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
- location String
- The location the Backend that this Traffic config applies to
- name String
- Identifier. The resource name of the backend traffic config
Format:
projects/{project}/locations/{locationId}/backends/{backendId}/traffic. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rollout
Policy Property Map - The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
- target Property Map
- Set to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100. Structure is documented below.
- uid String
- System-assigned, unique identifier.
- update
Time String - Time at which the backend was last updated.
Supporting Types
AppHostingTrafficCurrent, AppHostingTrafficCurrentArgs
- Splits
List<App
Hosting Traffic Current Split> - (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- Splits
[]App
Hosting Traffic Current Split - (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits list(object)
- (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits
List<App
Hosting Traffic Current Split> - (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits
App
Hosting Traffic Current Split[] - (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits
Sequence[App
Hosting Traffic Current Split] - (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits List<Property Map>
- (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
AppHostingTrafficCurrentSplit, AppHostingTrafficCurrentSplitArgs
AppHostingTrafficRolloutPolicy, AppHostingTrafficRolloutPolicyArgs
- Codebase
Branch string - Specifies a branch that triggers a new build to be started with this policy. If not set, no automatic rollouts will happen.
- Disabled bool
- A flag that, if true, prevents rollouts from being created via this RolloutPolicy.
- Disabled
Time string - (Output) If disabled is set, the time at which the rollouts were disabled.
- Ignored
Paths List<AppHosting Traffic Rollout Policy Ignored Path> - A list of file paths patterns to exclude from triggering a rollout. Patterns in this list take precedence over required_paths. Note: All paths must be in the ignoredPaths in order for the rollout to be skipped. Limited to 100 paths. Structure is documented below.
- Required
Paths List<AppHosting Traffic Rollout Policy Required Path> - A list of file paths patterns that trigger a build and rollout if at least one of the changed files in the commit are present in this list. This field is optional; the rollout policy will default to triggering on all paths if both ignoredPaths and requiredPaths are not populated. Limited to 100 paths. Structure is documented below.
- Codebase
Branch string - Specifies a branch that triggers a new build to be started with this policy. If not set, no automatic rollouts will happen.
- Disabled bool
- A flag that, if true, prevents rollouts from being created via this RolloutPolicy.
- Disabled
Time string - (Output) If disabled is set, the time at which the rollouts were disabled.
- Ignored
Paths []AppHosting Traffic Rollout Policy Ignored Path - A list of file paths patterns to exclude from triggering a rollout. Patterns in this list take precedence over required_paths. Note: All paths must be in the ignoredPaths in order for the rollout to be skipped. Limited to 100 paths. Structure is documented below.
- Required
Paths []AppHosting Traffic Rollout Policy Required Path - A list of file paths patterns that trigger a build and rollout if at least one of the changed files in the commit are present in this list. This field is optional; the rollout policy will default to triggering on all paths if both ignoredPaths and requiredPaths are not populated. Limited to 100 paths. Structure is documented below.
- codebase_
branch string - Specifies a branch that triggers a new build to be started with this policy. If not set, no automatic rollouts will happen.
- disabled bool
- A flag that, if true, prevents rollouts from being created via this RolloutPolicy.
- disabled_
time string - (Output) If disabled is set, the time at which the rollouts were disabled.
- ignored_
paths list(object) - A list of file paths patterns to exclude from triggering a rollout. Patterns in this list take precedence over required_paths. Note: All paths must be in the ignoredPaths in order for the rollout to be skipped. Limited to 100 paths. Structure is documented below.
- required_
paths list(object) - A list of file paths patterns that trigger a build and rollout if at least one of the changed files in the commit are present in this list. This field is optional; the rollout policy will default to triggering on all paths if both ignoredPaths and requiredPaths are not populated. Limited to 100 paths. Structure is documented below.
- codebase
Branch String - Specifies a branch that triggers a new build to be started with this policy. If not set, no automatic rollouts will happen.
- disabled Boolean
- A flag that, if true, prevents rollouts from being created via this RolloutPolicy.
- disabled
Time String - (Output) If disabled is set, the time at which the rollouts were disabled.
- ignored
Paths List<AppHosting Traffic Rollout Policy Ignored Path> - A list of file paths patterns to exclude from triggering a rollout. Patterns in this list take precedence over required_paths. Note: All paths must be in the ignoredPaths in order for the rollout to be skipped. Limited to 100 paths. Structure is documented below.
- required
Paths List<AppHosting Traffic Rollout Policy Required Path> - A list of file paths patterns that trigger a build and rollout if at least one of the changed files in the commit are present in this list. This field is optional; the rollout policy will default to triggering on all paths if both ignoredPaths and requiredPaths are not populated. Limited to 100 paths. Structure is documented below.
- codebase
Branch string - Specifies a branch that triggers a new build to be started with this policy. If not set, no automatic rollouts will happen.
- disabled boolean
- A flag that, if true, prevents rollouts from being created via this RolloutPolicy.
- disabled
Time string - (Output) If disabled is set, the time at which the rollouts were disabled.
- ignored
Paths AppHosting Traffic Rollout Policy Ignored Path[] - A list of file paths patterns to exclude from triggering a rollout. Patterns in this list take precedence over required_paths. Note: All paths must be in the ignoredPaths in order for the rollout to be skipped. Limited to 100 paths. Structure is documented below.
- required
Paths AppHosting Traffic Rollout Policy Required Path[] - A list of file paths patterns that trigger a build and rollout if at least one of the changed files in the commit are present in this list. This field is optional; the rollout policy will default to triggering on all paths if both ignoredPaths and requiredPaths are not populated. Limited to 100 paths. Structure is documented below.
- codebase_
branch str - Specifies a branch that triggers a new build to be started with this policy. If not set, no automatic rollouts will happen.
- disabled bool
- A flag that, if true, prevents rollouts from being created via this RolloutPolicy.
- disabled_
time str - (Output) If disabled is set, the time at which the rollouts were disabled.
- ignored_
paths Sequence[AppHosting Traffic Rollout Policy Ignored Path] - A list of file paths patterns to exclude from triggering a rollout. Patterns in this list take precedence over required_paths. Note: All paths must be in the ignoredPaths in order for the rollout to be skipped. Limited to 100 paths. Structure is documented below.
- required_
paths Sequence[AppHosting Traffic Rollout Policy Required Path] - A list of file paths patterns that trigger a build and rollout if at least one of the changed files in the commit are present in this list. This field is optional; the rollout policy will default to triggering on all paths if both ignoredPaths and requiredPaths are not populated. Limited to 100 paths. Structure is documented below.
- codebase
Branch String - Specifies a branch that triggers a new build to be started with this policy. If not set, no automatic rollouts will happen.
- disabled Boolean
- A flag that, if true, prevents rollouts from being created via this RolloutPolicy.
- disabled
Time String - (Output) If disabled is set, the time at which the rollouts were disabled.
- ignored
Paths List<Property Map> - A list of file paths patterns to exclude from triggering a rollout. Patterns in this list take precedence over required_paths. Note: All paths must be in the ignoredPaths in order for the rollout to be skipped. Limited to 100 paths. Structure is documented below.
- required
Paths List<Property Map> - A list of file paths patterns that trigger a build and rollout if at least one of the changed files in the commit are present in this list. This field is optional; the rollout policy will default to triggering on all paths if both ignoredPaths and requiredPaths are not populated. Limited to 100 paths. Structure is documented below.
AppHostingTrafficRolloutPolicyIgnoredPath, AppHostingTrafficRolloutPolicyIgnoredPathArgs
AppHostingTrafficRolloutPolicyRequiredPath, AppHostingTrafficRolloutPolicyRequiredPathArgs
AppHostingTrafficTarget, AppHostingTrafficTargetArgs
- Splits
List<App
Hosting Traffic Target Split> - A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- Splits
[]App
Hosting Traffic Target Split - A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits list(object)
- A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits
List<App
Hosting Traffic Target Split> - A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits
App
Hosting Traffic Target Split[] - A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits
Sequence[App
Hosting Traffic Target Split] - A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
- splits List<Property Map>
- A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
AppHostingTrafficTargetSplit, AppHostingTrafficTargetSplitArgs
Import
Traffic can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/backends/{{backend}}/traffic{{project}}/{{location}}/{{backend}}{{location}}/{{backend}}
When using the pulumi import command, Traffic can be imported using one of the formats above. For example:
$ pulumi import gcp:firebase/appHostingTraffic:AppHostingTraffic default projects/{{project}}/locations/{{location}}/backends/{{backend}}/traffic
$ pulumi import gcp:firebase/appHostingTraffic:AppHostingTraffic default {{project}}/{{location}}/{{backend}}
$ pulumi import gcp:firebase/appHostingTraffic:AppHostingTraffic default {{location}}/{{backend}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
published on Wednesday, Nov 18, 2026 by Pulumi