1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getWorkers
Cloudflare v6.8.0 published on Saturday, Aug 30, 2025 by Pulumi

cloudflare.getWorkers

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.8.0 published on Saturday, Aug 30, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleWorkers = cloudflare.getWorkers({
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_workers = cloudflare.get_workers(account_id="023e105f4ecef8ad9ca31a8372d0c353")
    
    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.LookupWorkers(ctx, &cloudflare.LookupWorkersArgs{
    			AccountId: "023e105f4ecef8ad9ca31a8372d0c353",
    		}, nil)
    		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 exampleWorkers = Cloudflare.GetWorkers.Invoke(new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetWorkersArgs;
    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) {
            final var exampleWorkers = CloudflareFunctions.getWorkers(GetWorkersArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .build());
    
        }
    }
    
    variables:
      exampleWorkers:
        fn::invoke:
          function: cloudflare:getWorkers
          arguments:
            accountId: 023e105f4ecef8ad9ca31a8372d0c353
    

    Using getWorkers

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getWorkers(args: GetWorkersArgs, opts?: InvokeOptions): Promise<GetWorkersResult>
    function getWorkersOutput(args: GetWorkersOutputArgs, opts?: InvokeOptions): Output<GetWorkersResult>
    def get_workers(account_id: Optional[str] = None,
                    max_items: Optional[int] = None,
                    opts: Optional[InvokeOptions] = None) -> GetWorkersResult
    def get_workers_output(account_id: Optional[pulumi.Input[str]] = None,
                    max_items: Optional[pulumi.Input[int]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetWorkersResult]
    func LookupWorkers(ctx *Context, args *LookupWorkersArgs, opts ...InvokeOption) (*LookupWorkersResult, error)
    func LookupWorkersOutput(ctx *Context, args *LookupWorkersOutputArgs, opts ...InvokeOption) LookupWorkersResultOutput

    > Note: This function is named LookupWorkers in the Go SDK.

    public static class GetWorkers 
    {
        public static Task<GetWorkersResult> InvokeAsync(GetWorkersArgs args, InvokeOptions? opts = null)
        public static Output<GetWorkersResult> Invoke(GetWorkersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetWorkersResult> getWorkers(GetWorkersArgs args, InvokeOptions options)
    public static Output<GetWorkersResult> getWorkers(GetWorkersArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getWorkers:getWorkers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    Identifier.
    MaxItems int
    Max items to fetch, default: 1000
    AccountId string
    Identifier.
    MaxItems int
    Max items to fetch, default: 1000
    accountId String
    Identifier.
    maxItems Integer
    Max items to fetch, default: 1000
    accountId string
    Identifier.
    maxItems number
    Max items to fetch, default: 1000
    account_id str
    Identifier.
    max_items int
    Max items to fetch, default: 1000
    accountId String
    Identifier.
    maxItems Number
    Max items to fetch, default: 1000

    getWorkers Result

    The following output properties are available:

    AccountId string
    Identifier.
    Id string
    The provider-assigned unique ID for this managed resource.
    Results List<GetWorkersResult>
    The items returned by the data source
    MaxItems int
    Max items to fetch, default: 1000
    AccountId string
    Identifier.
    Id string
    The provider-assigned unique ID for this managed resource.
    Results []GetWorkersResult
    The items returned by the data source
    MaxItems int
    Max items to fetch, default: 1000
    accountId String
    Identifier.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<GetWorkersResult>
    The items returned by the data source
    maxItems Integer
    Max items to fetch, default: 1000
    accountId string
    Identifier.
    id string
    The provider-assigned unique ID for this managed resource.
    results GetWorkersResult[]
    The items returned by the data source
    maxItems number
    Max items to fetch, default: 1000
    account_id str
    Identifier.
    id str
    The provider-assigned unique ID for this managed resource.
    results Sequence[GetWorkersResult]
    The items returned by the data source
    max_items int
    Max items to fetch, default: 1000
    accountId String
    Identifier.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<Property Map>
    The items returned by the data source
    maxItems Number
    Max items to fetch, default: 1000

    Supporting Types

    GetWorkersResult

    CreatedOn string
    When the Worker was created.
    Id string
    Identifier.
    Logpush bool
    Whether logpush is enabled for the Worker.
    Name string
    Name of the Worker.
    Observability GetWorkersResultObservability
    Observability settings for the Worker.
    Subdomain GetWorkersResultSubdomain
    Subdomain settings for the Worker.
    Tags List<string>
    Tags associated with the Worker.
    TailConsumers List<GetWorkersResultTailConsumer>
    Other Workers that should consume logs from the Worker.
    UpdatedOn string
    When the Worker was most recently updated.
    CreatedOn string
    When the Worker was created.
    Id string
    Identifier.
    Logpush bool
    Whether logpush is enabled for the Worker.
    Name string
    Name of the Worker.
    Observability GetWorkersResultObservability
    Observability settings for the Worker.
    Subdomain GetWorkersResultSubdomain
    Subdomain settings for the Worker.
    Tags []string
    Tags associated with the Worker.
    TailConsumers []GetWorkersResultTailConsumer
    Other Workers that should consume logs from the Worker.
    UpdatedOn string
    When the Worker was most recently updated.
    createdOn String
    When the Worker was created.
    id String
    Identifier.
    logpush Boolean
    Whether logpush is enabled for the Worker.
    name String
    Name of the Worker.
    observability GetWorkersResultObservability
    Observability settings for the Worker.
    subdomain GetWorkersResultSubdomain
    Subdomain settings for the Worker.
    tags List<String>
    Tags associated with the Worker.
    tailConsumers List<GetWorkersResultTailConsumer>
    Other Workers that should consume logs from the Worker.
    updatedOn String
    When the Worker was most recently updated.
    createdOn string
    When the Worker was created.
    id string
    Identifier.
    logpush boolean
    Whether logpush is enabled for the Worker.
    name string
    Name of the Worker.
    observability GetWorkersResultObservability
    Observability settings for the Worker.
    subdomain GetWorkersResultSubdomain
    Subdomain settings for the Worker.
    tags string[]
    Tags associated with the Worker.
    tailConsumers GetWorkersResultTailConsumer[]
    Other Workers that should consume logs from the Worker.
    updatedOn string
    When the Worker was most recently updated.
    created_on str
    When the Worker was created.
    id str
    Identifier.
    logpush bool
    Whether logpush is enabled for the Worker.
    name str
    Name of the Worker.
    observability GetWorkersResultObservability
    Observability settings for the Worker.
    subdomain GetWorkersResultSubdomain
    Subdomain settings for the Worker.
    tags Sequence[str]
    Tags associated with the Worker.
    tail_consumers Sequence[GetWorkersResultTailConsumer]
    Other Workers that should consume logs from the Worker.
    updated_on str
    When the Worker was most recently updated.
    createdOn String
    When the Worker was created.
    id String
    Identifier.
    logpush Boolean
    Whether logpush is enabled for the Worker.
    name String
    Name of the Worker.
    observability Property Map
    Observability settings for the Worker.
    subdomain Property Map
    Subdomain settings for the Worker.
    tags List<String>
    Tags associated with the Worker.
    tailConsumers List<Property Map>
    Other Workers that should consume logs from the Worker.
    updatedOn String
    When the Worker was most recently updated.

    GetWorkersResultObservability

    Enabled bool
    Whether observability is enabled for the Worker.
    HeadSamplingRate double
    The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).
    Logs GetWorkersResultObservabilityLogs
    Log settings for the Worker.
    Enabled bool
    Whether observability is enabled for the Worker.
    HeadSamplingRate float64
    The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).
    Logs GetWorkersResultObservabilityLogs
    Log settings for the Worker.
    enabled Boolean
    Whether observability is enabled for the Worker.
    headSamplingRate Double
    The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).
    logs GetWorkersResultObservabilityLogs
    Log settings for the Worker.
    enabled boolean
    Whether observability is enabled for the Worker.
    headSamplingRate number
    The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).
    logs GetWorkersResultObservabilityLogs
    Log settings for the Worker.
    enabled bool
    Whether observability is enabled for the Worker.
    head_sampling_rate float
    The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).
    logs GetWorkersResultObservabilityLogs
    Log settings for the Worker.
    enabled Boolean
    Whether observability is enabled for the Worker.
    headSamplingRate Number
    The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).
    logs Property Map
    Log settings for the Worker.

    GetWorkersResultObservabilityLogs

    Enabled bool
    Whether logs are enabled for the Worker.
    HeadSamplingRate double
    The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).
    InvocationLogs bool
    Whether invocation logs are enabled for the Worker.
    Enabled bool
    Whether logs are enabled for the Worker.
    HeadSamplingRate float64
    The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).
    InvocationLogs bool
    Whether invocation logs are enabled for the Worker.
    enabled Boolean
    Whether logs are enabled for the Worker.
    headSamplingRate Double
    The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).
    invocationLogs Boolean
    Whether invocation logs are enabled for the Worker.
    enabled boolean
    Whether logs are enabled for the Worker.
    headSamplingRate number
    The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).
    invocationLogs boolean
    Whether invocation logs are enabled for the Worker.
    enabled bool
    Whether logs are enabled for the Worker.
    head_sampling_rate float
    The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).
    invocation_logs bool
    Whether invocation logs are enabled for the Worker.
    enabled Boolean
    Whether logs are enabled for the Worker.
    headSamplingRate Number
    The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).
    invocationLogs Boolean
    Whether invocation logs are enabled for the Worker.

    GetWorkersResultSubdomain

    Enabled bool
    Whether the *.workers.dev subdomain is enabled for the Worker.
    PreviewsEnabled bool
    Whether preview URLs are enabled for the Worker.
    Enabled bool
    Whether the *.workers.dev subdomain is enabled for the Worker.
    PreviewsEnabled bool
    Whether preview URLs are enabled for the Worker.
    enabled Boolean
    Whether the *.workers.dev subdomain is enabled for the Worker.
    previewsEnabled Boolean
    Whether preview URLs are enabled for the Worker.
    enabled boolean
    Whether the *.workers.dev subdomain is enabled for the Worker.
    previewsEnabled boolean
    Whether preview URLs are enabled for the Worker.
    enabled bool
    Whether the *.workers.dev subdomain is enabled for the Worker.
    previews_enabled bool
    Whether preview URLs are enabled for the Worker.
    enabled Boolean
    Whether the *.workers.dev subdomain is enabled for the Worker.
    previewsEnabled Boolean
    Whether preview URLs are enabled for the Worker.

    GetWorkersResultTailConsumer

    Name string
    Name of the consumer Worker.
    Name string
    Name of the consumer Worker.
    name String
    Name of the consumer Worker.
    name string
    Name of the consumer Worker.
    name str
    Name of the consumer Worker.
    name String
    Name of the consumer Worker.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.8.0 published on Saturday, Aug 30, 2025 by Pulumi