import * as pulumi from "@pulumi/pulumi"; /** * Provides a Cloudflare worker route resource. A route will also require a `cloudflare.WorkerScript`. *NOTE:* This resource uses the Cloudflare account APIs. This requires setting the `CLOUDFLARE_ACCOUNT_ID` environment variable or `accountId` provider argument. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi_cloudflare from "@mapped/pulumi-cloudflare"; * * const myScript = new cloudflare.WorkerScript("myScript", {}); * // see "cloudflare_worker_script" documentation ... * // Runs the specified worker script for all URLs that match `example.com/*` * const myRoute = new cloudflare.WorkerRoute("myRoute", { * zoneId: "d41d8cd98f00b204e9800998ecf8427e", * pattern: "example.com/*", * scriptName: myScript.name, * }); * ``` * * ## Import * * Records can be imported using a composite ID formed of zone ID and route ID, e.g. * * ```sh * $ pulumi import cloudflare:index/workerRoute:WorkerRoute default d41d8cd98f00b204e9800998ecf8427e/9a7806061c88ada191ed06f989cc3dac * ``` * * where* `d41d8cd98f00b204e9800998ecf8427e` - zone ID * `9a7806061c88ada191ed06f989cc3dac` - route ID as returned by [API](https://api.cloudflare.com/#worker-filters-list-filters) */ export declare class WorkerRoute extends pulumi.CustomResource { /** * Get an existing WorkerRoute resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: WorkerRouteState, opts?: pulumi.CustomResourceOptions): WorkerRoute; /** * Returns true if the given object is an instance of WorkerRoute. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is WorkerRoute; /** * The [route pattern](https://developers.cloudflare.com/workers/about/routes/) */ readonly pattern: pulumi.Output; /** * Which worker script to run for requests that match the route pattern. If `scriptName` is empty, workers will be skipped for matching requests. */ readonly scriptName: pulumi.Output; /** * The zone ID to add the route to. */ readonly zoneId: pulumi.Output; /** * Create a WorkerRoute resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: WorkerRouteArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering WorkerRoute resources. */ export interface WorkerRouteState { /** * The [route pattern](https://developers.cloudflare.com/workers/about/routes/) */ pattern?: pulumi.Input; /** * Which worker script to run for requests that match the route pattern. If `scriptName` is empty, workers will be skipped for matching requests. */ scriptName?: pulumi.Input; /** * The zone ID to add the route to. */ zoneId?: pulumi.Input; } /** * The set of arguments for constructing a WorkerRoute resource. */ export interface WorkerRouteArgs { /** * The [route pattern](https://developers.cloudflare.com/workers/about/routes/) */ pattern: pulumi.Input; /** * Which worker script to run for requests that match the route pattern. If `scriptName` is empty, workers will be skipped for matching requests. */ scriptName?: pulumi.Input; /** * The zone ID to add the route to. */ zoneId: pulumi.Input; }