Rules to match an HTTP request and dispatch that request to a service.
To get more information about ApplicationUrlDispatchRules, see:
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 = "nodejs20"
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"
}
delete_service_on_destroy = true
}
resource "google_storage_bucket" "bucket" {
name = "appengine-test-bucket"
location = "US"
}
resource "google_storage_bucket_object" "object" {
name = "hello-world.zip"
bucket = google_storage_bucket.bucket.name
source = "./test-fixtures/hello-world.zip"
}
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.In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format {{project}}
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.ApplicationUrlDispatchRules can be imported using any of these accepted formats:
{{project}}
In Terraform v1.5.0 and later, use an import
block to import ApplicationUrlDispatchRules using one of the formats above. For example:
import {
id = "{{project}}"
to = google_app_engine_application_url_dispatch_rules.default
}
When using the terraform import
command, ApplicationUrlDispatchRules can be imported using one of the formats above. For example:
$ terraform import google_app_engine_application_url_dispatch_rules.default {{project}}
This resource supports User Project Overrides.