» google_app_engine_application_url_dispatch_rules

Rules to match an HTTP request and dispatch that request to a service.

To get more information about ApplicationUrlDispatchRules, see:

» Example Usage - App Engine Application Url Dispatch Rules Basic

resource "google_app_engine_application_url_dispatch_rules" "web_service" {
  dispatch_rules {
    domain  = "*"
    path    = "/*"
    service = "default"
  }

  dispatch_rules {
    domain  = "*"
    path    = "/admin/*"
    service = google_app_engine_standard_app_version.admin_v3.service
  }
}

resource "google_app_engine_standard_app_version" "admin_v3" {
  version_id = "v3"
  service    = "admin"
  runtime    = "nodejs10"

  entrypoint {
    shell = "node ./app.js"
  }

  deployment {
    zip {
      source_url = "https://storage.googleapis.com/${google_storage_bucket.bucket.name}/${google_storage_bucket_object.object.name}"
    }
  }

  env_variables = {
    port = "8080"
  }

  noop_on_destroy = true
}

resource "google_storage_bucket" "bucket" {
  name = "appengine-test-bucket"
}

resource "google_storage_bucket_object" "object" {
  name   = "hello-world.zip"
  bucket = google_storage_bucket.bucket.name
  source = "./test-fixtures/appengine/hello-world.zip"
}

» Argument Reference

The following arguments are supported:

  • dispatch_rules - (Required) Rules to match an HTTP request and dispatch that request to a service. Structure is documented below.

The dispatch_rules block supports:

  • domain - (Optional) Domain name to match against. The wildcard "" is supported if specified before a period: ".". Defaults to matching all domains: "*".

  • path - (Required) Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters.

  • service - (Required) Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters.


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

» Timeouts

This resource provides the following Timeouts configuration options:

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

» Import

ApplicationUrlDispatchRules can be imported using any of these accepted formats:

$ terraform import google_app_engine_application_url_dispatch_rules.default {{project}}

» User Project Overrides

This resource supports User Project Overrides.