Provides a Cloudflare worker route resource. A route will also require a cloudflare_worker_script
.
# Runs the specified worker script for all URLs that match `example.com/*`
resource "cloudflare_worker_route" "my_route" {
zone_id = "0da42c8d2132a9ddaf714f9e7c920711"
pattern = "example.com/*"
script_name = cloudflare_worker_script.my_script.name
}
resource "cloudflare_worker_script" "my_script" {
# see "cloudflare_worker_script" documentation ...
}
pattern
(String) The route pattern to associate the Worker with.zone_id
(String) The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.script_name
(String) Worker script name to invoke for requests that match the route pattern.id
(String) The ID of this resource.Import is supported using the following syntax:
$ terraform import cloudflare_worker_route.example <zone_id>/<route_id>