Skip to content

googleAppEngineApplicationUrlDispatchRules

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

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleStorageBucketBucket = new google.storageBucket.StorageBucket(
  this,
  "bucket",
  {
    location: "US",
    name: "appengine-test-bucket",
  }
);
const googleStorageBucketObjectObject =
  new google.storageBucketObject.StorageBucketObject(this, "object", {
    bucket: googleStorageBucketBucket.name,
    name: "hello-world.zip",
    source: "./test-fixtures/appengine/hello-world.zip",
  });
const googleAppEngineStandardAppVersionAdminV3 =
  new google.appEngineStandardAppVersion.AppEngineStandardAppVersion(
    this,
    "admin_v3",
    {
      deployment: [
        {
          zip: [
            {
              source_url: `https://storage.googleapis.com/\${${googleStorageBucketBucket.name}}/\${${googleStorageBucketObjectObject.name}}`,
            },
          ],
        },
      ],
      entrypoint: [
        {
          shell: "node ./app.js",
        },
      ],
      env_variables: [
        {
          port: "8080",
        },
      ],
      noop_on_destroy: true,
      runtime: "nodejs10",
      service: "admin",
      version_id: "v3",
    }
  );
new google.appEngineApplicationUrlDispatchRules.AppEngineApplicationUrlDispatchRules(
  this,
  "web_service",
  {
    dispatch_rules: [
      {
        domain: "*",
        path: "/*",
        service: "default",
      },
      {
        domain: "*",
        path: "/admin/*",
        service: googleAppEngineStandardAppVersionAdminV3.service,
      },
    ],
  }
);

Argument Reference

The following arguments are supported:

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

The dispatchRules 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.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format {{project}}

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 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.