1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firebase
  5. AppHostingTraffic
Google Cloud v8.34.0 published on Wednesday, Jun 11, 2025 by Pulumi

gcp.firebase.AppHostingTraffic

Explore with Pulumi AI

gcp logo
Google Cloud v8.34.0 published on Wednesday, Jun 11, 2025 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",
        disableOnDestroy: false,
    });
    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",
        disable_on_destroy=False)
    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/v8/go/gcp/firebase"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/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"),
    			DisableOnDestroy: pulumi.Bool(false),
    		})
    		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",
            DisableOnDestroy = false,
        });
    
        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.projects.IAMMember;
    import com.pulumi.gcp.projects.IAMMemberArgs;
    import com.pulumi.resources.CustomResourceOptions;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            //## 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")
                .disableOnDestroy(false)
                .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
          disableOnDestroy: false
    

    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",
        disableOnDestroy: false,
    });
    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",
        disable_on_destroy=False)
    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/v8/go/gcp/firebase"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/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"),
    			DisableOnDestroy: pulumi.Bool(false),
    		})
    		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",
            DisableOnDestroy = false,
        });
    
        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.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            //## 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")
                .disableOnDestroy(false)
                .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
          disableOnDestroy: false
    

    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",
        disableOnDestroy: false,
    });
    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",
        disable_on_destroy=False)
    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/v8/go/gcp/firebase"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/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"),
    			DisableOnDestroy: pulumi.Bool(false),
    		})
    		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",
            DisableOnDestroy = false,
        });
    
        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.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            //## 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")
                .disableOnDestroy(false)
                .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
          disableOnDestroy: false
    

    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.
    
    

    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",
        },
        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"),
    	},
    	Target: &firebase.AppHostingTrafficTargetArgs{
    		Splits: firebase.AppHostingTrafficTargetSplitArray{
    			&firebase.AppHostingTrafficTargetSplitArgs{
    				Build:   pulumi.String("string"),
    				Percent: pulumi.Int(0),
    			},
    		},
    	},
    })
    
    var appHostingTrafficResource = new AppHostingTraffic("appHostingTrafficResource", AppHostingTrafficArgs.builder()
        .backend("string")
        .location("string")
        .project("string")
        .rolloutPolicy(AppHostingTrafficRolloutPolicyArgs.builder()
            .codebaseBranch("string")
            .disabled(false)
            .disabledTime("string")
            .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",
        },
        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",
        },
        target: {
            splits: [{
                build: "string",
                percent: 0,
            }],
        },
    });
    
    type: gcp:firebase:AppHostingTraffic
    properties:
        backend: string
        location: string
        project: string
        rolloutPolicy:
            codebaseBranch: string
            disabled: false
            disabledTime: 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.
    RolloutPolicy AppHostingTrafficRolloutPolicy
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    Target AppHostingTrafficTarget
    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.
    RolloutPolicy AppHostingTrafficRolloutPolicyArgs
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    Target AppHostingTrafficTargetArgs
    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.
    rolloutPolicy AppHostingTrafficRolloutPolicy
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    target AppHostingTrafficTarget
    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.
    rolloutPolicy AppHostingTrafficRolloutPolicy
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    target AppHostingTrafficTarget
    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 AppHostingTrafficRolloutPolicyArgs
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    target AppHostingTrafficTargetArgs
    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.
    rolloutPolicy 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:

    CreateTime string
    Time at which the backend was created.
    Currents List<AppHostingTrafficCurrent>
    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.
    DeleteTime 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.
    UpdateTime string
    Time at which the backend was last updated.
    CreateTime string
    Time at which the backend was created.
    Currents []AppHostingTrafficCurrent
    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.
    DeleteTime 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.
    UpdateTime string
    Time at which the backend was last updated.
    createTime String
    Time at which the backend was created.
    currents List<AppHostingTrafficCurrent>
    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.
    deleteTime 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.
    updateTime String
    Time at which the backend was last updated.
    createTime string
    Time at which the backend was created.
    currents AppHostingTrafficCurrent[]
    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.
    deleteTime 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.
    updateTime string
    Time at which the backend was last updated.
    create_time str
    Time at which the backend was created.
    currents Sequence[AppHostingTrafficCurrent]
    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.
    createTime 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.
    deleteTime 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.
    updateTime 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) -> AppHostingTraffic
    func 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:  _:    type: gcp:firebase:AppHostingTraffic    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Backend string
    Id of the backend that this Traffic config applies to


    CreateTime string
    Time at which the backend was created.
    Currents List<AppHostingTrafficCurrent>
    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.
    DeleteTime 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.
    RolloutPolicy AppHostingTrafficRolloutPolicy
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    Target AppHostingTrafficTarget
    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.
    UpdateTime string
    Time at which the backend was last updated.
    Backend string
    Id of the backend that this Traffic config applies to


    CreateTime string
    Time at which the backend was created.
    Currents []AppHostingTrafficCurrentArgs
    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.
    DeleteTime 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.
    RolloutPolicy AppHostingTrafficRolloutPolicyArgs
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    Target AppHostingTrafficTargetArgs
    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.
    UpdateTime string
    Time at which the backend was last updated.
    backend String
    Id of the backend that this Traffic config applies to


    createTime String
    Time at which the backend was created.
    currents List<AppHostingTrafficCurrent>
    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.
    deleteTime 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.
    rolloutPolicy AppHostingTrafficRolloutPolicy
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    target AppHostingTrafficTarget
    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.
    updateTime String
    Time at which the backend was last updated.
    backend string
    Id of the backend that this Traffic config applies to


    createTime string
    Time at which the backend was created.
    currents AppHostingTrafficCurrent[]
    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.
    deleteTime 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.
    rolloutPolicy AppHostingTrafficRolloutPolicy
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    target AppHostingTrafficTarget
    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.
    updateTime 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[AppHostingTrafficCurrentArgs]
    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 AppHostingTrafficRolloutPolicyArgs
    The policy for how builds and rollouts are triggered and rolled out. Structure is documented below.
    target AppHostingTrafficTargetArgs
    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


    createTime 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.
    deleteTime 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.
    rolloutPolicy 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.
    updateTime String
    Time at which the backend was last updated.

    Supporting Types

    AppHostingTrafficCurrent, AppHostingTrafficCurrentArgs

    Splits List<AppHostingTrafficCurrentSplit>
    (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
    Splits []AppHostingTrafficCurrentSplit
    (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
    splits List<AppHostingTrafficCurrentSplit>
    (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
    splits AppHostingTrafficCurrentSplit[]
    (Output) A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
    splits Sequence[AppHostingTrafficCurrentSplit]
    (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

    Build string
    The build that traffic is being routed to.
    Percent int
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    Build string
    The build that traffic is being routed to.
    Percent int
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    build String
    The build that traffic is being routed to.
    percent Integer
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    build string
    The build that traffic is being routed to.
    percent number
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    build str
    The build that traffic is being routed to.
    percent int
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    build String
    The build that traffic is being routed to.
    percent Number
    The percentage of traffic to send to the build. Currently must be 100 or 0.

    AppHostingTrafficRolloutPolicy, AppHostingTrafficRolloutPolicyArgs

    CodebaseBranch 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.
    DisabledTime string
    (Output) If disabled is set, the time at which the rollouts were disabled.
    CodebaseBranch 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.
    DisabledTime string
    (Output) If disabled is set, the time at which the rollouts were disabled.
    codebaseBranch 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.
    disabledTime String
    (Output) If disabled is set, the time at which the rollouts were disabled.
    codebaseBranch 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.
    disabledTime string
    (Output) If disabled is set, the time at which the rollouts were disabled.
    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.
    codebaseBranch 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.
    disabledTime String
    (Output) If disabled is set, the time at which the rollouts were disabled.

    AppHostingTrafficTarget, AppHostingTrafficTargetArgs

    Splits List<AppHostingTrafficTargetSplit>
    A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
    Splits []AppHostingTrafficTargetSplit
    A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
    splits List<AppHostingTrafficTargetSplit>
    A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
    splits AppHostingTrafficTargetSplit[]
    A list of traffic splits that together represent where traffic is being routed. Structure is documented below.
    splits Sequence[AppHostingTrafficTargetSplit]
    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

    Build string
    The build that traffic is being routed to.
    Percent int
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    Build string
    The build that traffic is being routed to.
    Percent int
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    build String
    The build that traffic is being routed to.
    percent Integer
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    build string
    The build that traffic is being routed to.
    percent number
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    build str
    The build that traffic is being routed to.
    percent int
    The percentage of traffic to send to the build. Currently must be 100 or 0.
    build String
    The build that traffic is being routed to.
    percent Number
    The percentage of traffic to send to the build. Currently must be 100 or 0.

    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) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud v8.34.0 published on Wednesday, Jun 11, 2025 by Pulumi