1. Packages
  2. Packages
  3. Cloudflare Provider
  4. API Docs
  5. WorkerDomain
Viewing docs for Cloudflare v6.15.0
published on Saturday, May 2, 2026 by Pulumi
cloudflare logo
Viewing docs for Cloudflare v6.15.0
published on Saturday, May 2, 2026 by Pulumi
    Deprecated: cloudflare.index/workerdomain.WorkerDomain has been deprecated in favor of cloudflare.index/workerscustomdomain.WorkersCustomDomain

    Accepted Permissions

    • Workers Scripts Read
    • Workers Scripts Write

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleWorkersCustomDomain = new cloudflare.WorkersCustomDomain("example_workers_custom_domain", {
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        hostname: "app.example.com",
        service: "my-worker",
        environment: "production",
        zoneId: "593c9c94de529bbbfaac7c53ced0447d",
        zoneName: "example.com",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_workers_custom_domain = cloudflare.WorkersCustomDomain("example_workers_custom_domain",
        account_id="023e105f4ecef8ad9ca31a8372d0c353",
        hostname="app.example.com",
        service="my-worker",
        environment="production",
        zone_id="593c9c94de529bbbfaac7c53ced0447d",
        zone_name="example.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.NewWorkersCustomDomain(ctx, "example_workers_custom_domain", &cloudflare.WorkersCustomDomainArgs{
    			AccountId:   pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    			Hostname:    pulumi.String("app.example.com"),
    			Service:     pulumi.String("my-worker"),
    			Environment: pulumi.String("production"),
    			ZoneId:      pulumi.String("593c9c94de529bbbfaac7c53ced0447d"),
    			ZoneName:    pulumi.String("example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleWorkersCustomDomain = new Cloudflare.Index.WorkersCustomDomain("example_workers_custom_domain", new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            Hostname = "app.example.com",
            Service = "my-worker",
            Environment = "production",
            ZoneId = "593c9c94de529bbbfaac7c53ced0447d",
            ZoneName = "example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.WorkersCustomDomain;
    import com.pulumi.cloudflare.WorkersCustomDomainArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleWorkersCustomDomain = new WorkersCustomDomain("exampleWorkersCustomDomain", WorkersCustomDomainArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .hostname("app.example.com")
                .service("my-worker")
                .environment("production")
                .zoneId("593c9c94de529bbbfaac7c53ced0447d")
                .zoneName("example.com")
                .build());
    
        }
    }
    
    resources:
      exampleWorkersCustomDomain:
        type: cloudflare:WorkersCustomDomain
        name: example_workers_custom_domain
        properties:
          accountId: 023e105f4ecef8ad9ca31a8372d0c353
          hostname: app.example.com
          service: my-worker
          environment: production
          zoneId: 593c9c94de529bbbfaac7c53ced0447d
          zoneName: example.com
    

    Create WorkerDomain Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new WorkerDomain(name: string, args: WorkerDomainArgs, opts?: CustomResourceOptions);
    @overload
    def WorkerDomain(resource_name: str,
                     args: WorkerDomainArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def WorkerDomain(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     account_id: Optional[str] = None,
                     environment: Optional[str] = None,
                     hostname: Optional[str] = None,
                     service: Optional[str] = None,
                     zone_id: Optional[str] = None,
                     zone_name: Optional[str] = None)
    func NewWorkerDomain(ctx *Context, name string, args WorkerDomainArgs, opts ...ResourceOption) (*WorkerDomain, error)
    public WorkerDomain(string name, WorkerDomainArgs args, CustomResourceOptions? opts = null)
    public WorkerDomain(String name, WorkerDomainArgs args)
    public WorkerDomain(String name, WorkerDomainArgs args, CustomResourceOptions options)
    
    type: cloudflare:WorkerDomain
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args WorkerDomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args WorkerDomainArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args WorkerDomainArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkerDomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkerDomainArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    WorkerDomain Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The WorkerDomain resource accepts the following input properties:

    Hostname string
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    Service string
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    AccountId string
    Identifier.
    Environment string
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    ZoneId string
    ID of the zone containing the domain hostname.
    ZoneName string
    Name of the zone containing the domain hostname.
    Hostname string
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    Service string
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    AccountId string
    Identifier.
    Environment string
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    ZoneId string
    ID of the zone containing the domain hostname.
    ZoneName string
    Name of the zone containing the domain hostname.
    hostname String
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    service String
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    accountId String
    Identifier.
    environment String
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    zoneId String
    ID of the zone containing the domain hostname.
    zoneName String
    Name of the zone containing the domain hostname.
    hostname string
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    service string
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    accountId string
    Identifier.
    environment string
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    zoneId string
    ID of the zone containing the domain hostname.
    zoneName string
    Name of the zone containing the domain hostname.
    hostname str
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    service str
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    account_id str
    Identifier.
    environment str
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    zone_id str
    ID of the zone containing the domain hostname.
    zone_name str
    Name of the zone containing the domain hostname.
    hostname String
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    service String
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    accountId String
    Identifier.
    environment String
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    zoneId String
    ID of the zone containing the domain hostname.
    zoneName String
    Name of the zone containing the domain hostname.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WorkerDomain resource produces the following output properties:

    CertId string
    ID of the TLS certificate issued for the domain.
    Id string
    The provider-assigned unique ID for this managed resource.
    CertId string
    ID of the TLS certificate issued for the domain.
    Id string
    The provider-assigned unique ID for this managed resource.
    certId String
    ID of the TLS certificate issued for the domain.
    id String
    The provider-assigned unique ID for this managed resource.
    certId string
    ID of the TLS certificate issued for the domain.
    id string
    The provider-assigned unique ID for this managed resource.
    cert_id str
    ID of the TLS certificate issued for the domain.
    id str
    The provider-assigned unique ID for this managed resource.
    certId String
    ID of the TLS certificate issued for the domain.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing WorkerDomain Resource

    Get an existing WorkerDomain resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: WorkerDomainState, opts?: CustomResourceOptions): WorkerDomain
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            cert_id: Optional[str] = None,
            environment: Optional[str] = None,
            hostname: Optional[str] = None,
            service: Optional[str] = None,
            zone_id: Optional[str] = None,
            zone_name: Optional[str] = None) -> WorkerDomain
    func GetWorkerDomain(ctx *Context, name string, id IDInput, state *WorkerDomainState, opts ...ResourceOption) (*WorkerDomain, error)
    public static WorkerDomain Get(string name, Input<string> id, WorkerDomainState? state, CustomResourceOptions? opts = null)
    public static WorkerDomain get(String name, Output<String> id, WorkerDomainState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:WorkerDomain    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccountId string
    Identifier.
    CertId string
    ID of the TLS certificate issued for the domain.
    Environment string
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    Hostname string
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    Service string
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    ZoneId string
    ID of the zone containing the domain hostname.
    ZoneName string
    Name of the zone containing the domain hostname.
    AccountId string
    Identifier.
    CertId string
    ID of the TLS certificate issued for the domain.
    Environment string
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    Hostname string
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    Service string
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    ZoneId string
    ID of the zone containing the domain hostname.
    ZoneName string
    Name of the zone containing the domain hostname.
    accountId String
    Identifier.
    certId String
    ID of the TLS certificate issued for the domain.
    environment String
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    hostname String
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    service String
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    zoneId String
    ID of the zone containing the domain hostname.
    zoneName String
    Name of the zone containing the domain hostname.
    accountId string
    Identifier.
    certId string
    ID of the TLS certificate issued for the domain.
    environment string
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    hostname string
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    service string
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    zoneId string
    ID of the zone containing the domain hostname.
    zoneName string
    Name of the zone containing the domain hostname.
    account_id str
    Identifier.
    cert_id str
    ID of the TLS certificate issued for the domain.
    environment str
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    hostname str
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    service str
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    zone_id str
    ID of the zone containing the domain hostname.
    zone_name str
    Name of the zone containing the domain hostname.
    accountId String
    Identifier.
    certId String
    ID of the TLS certificate issued for the domain.
    environment String
    Worker environment associated with the domain.

    Deprecated: This attribute is deprecated.

    hostname String
    Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.
    service String
    Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.
    zoneId String
    ID of the zone containing the domain hostname.
    zoneName String
    Name of the zone containing the domain hostname.

    Import

    $ pulumi import cloudflare:index/workerDomain:WorkerDomain example '<account_id>/<domain_id>'
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Viewing docs for Cloudflare v6.15.0
    published on Saturday, May 2, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.