Google App Engine Service Split Traffic

This page shows how to write Terraform for App Engine Service Split Traffic and write them securely.

google_app_engine_service_split_traffic (Terraform)

The Service Split Traffic in App Engine can be configured in Terraform with the resource name google_app_engine_service_split_traffic. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "google_app_engine_service_split_traffic" "split_traffic" {
  service = var.service
  split {
    shard_by    = var.shard_by
    allocations = var.allocations
  }
main.tf#L7
resource "google_app_engine_service_split_traffic" "this" {
  migrate_traffic = var.migrate_traffic
  project         = var.project
  service         = var.service

  dynamic "split" {

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

If set to true traffic will be migrated to this version.

The name of the service these settings apply to.

  • split list block

    Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

    Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed. Possible values: ["UNSPECIFIED", "COOKIE", "IP", "RANDOM"]

  • timeouts single block

Explanation in Terraform Registry

Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions. To get more information about ServiceSplitTraffic, see:

Frequently asked questions

What is Google App Engine Service Split Traffic?

Google App Engine Service Split Traffic is a resource for App Engine of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google App Engine Service Split Traffic?

For Terraform, the bhidalto/terraform-appengine and niveklabs/google source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.