1. Registry
  2. Packages
  3. Cloudflare Provider
  4. API Docs
  5. getPrecursor
Viewing docs for Cloudflare v6.20.0
published on Tuesday, Aug 25, 2026 by Pulumi
cloudflare logo cloudflare logo
Viewing docs for Cloudflare v6.20.0
published on Tuesday, Aug 25, 2026 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const examplePrecursor = cloudflare.getPrecursor({
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_precursor = cloudflare.get_precursor(zone_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.GetPrecursor(ctx, &cloudflare.LookupPrecursorArgs{
    			ZoneId: "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 examplePrecursor = Cloudflare.GetPrecursor.Invoke(new()
        {
            ZoneId = "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.GetPrecursorArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 examplePrecursor = CloudflareFunctions.getPrecursor(GetPrecursorArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .build());
    
        }
    }
    
    variables:
      examplePrecursor:
        fn::invoke:
          function: cloudflare:getPrecursor
          arguments:
            zoneId: 023e105f4ecef8ad9ca31a8372d0c353
    
    pulumi {
      required_providers {
        cloudflare = {
          source = "pulumi/cloudflare"
        }
      }
    }
    
    data "cloudflare_getprecursor" "examplePrecursor" {
      zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
    }
    

    Using getPrecursor

    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 getPrecursor(args: GetPrecursorArgs, opts?: InvokeOptions): Promise<GetPrecursorResult>
    function getPrecursorOutput(args: GetPrecursorOutputArgs, opts?: InvokeOutputOptions): Output<GetPrecursorResult>
    def get_precursor(zone_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetPrecursorResult
    def get_precursor_output(zone_id: pulumi.Input[Optional[str]] = None,
                      opts: Optional[InvokeOutputOptions] = None) -> Output[GetPrecursorResult]
    func LookupPrecursor(ctx *Context, args *LookupPrecursorArgs, opts ...InvokeOption) (*LookupPrecursorResult, error)
    func LookupPrecursorOutput(ctx *Context, args *LookupPrecursorOutputArgs, opts ...InvokeOption) LookupPrecursorResultOutput

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

    public static class GetPrecursor 
    {
        public static Task<GetPrecursorResult> InvokeAsync(GetPrecursorArgs args, InvokeOptions? opts = null)
        public static Output<GetPrecursorResult> Invoke(GetPrecursorInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetPrecursorResult> Invoke(GetPrecursorInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetPrecursorResult> getPrecursor(GetPrecursorArgs args, InvokeOptions options)
    public static Output<GetPrecursorResult> getPrecursor(GetPrecursorArgs args, InvokeOptions options)
    public static Output<GetPrecursorResult> getPrecursor(GetPrecursorArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: cloudflare:index/getPrecursor:getPrecursor
      arguments:
        # arguments dictionary
    data "cloudflare_get_precursor" "name" {
        # arguments
    }

    The following arguments are supported:

    ZoneId string
    Identifier.
    ZoneId string
    Identifier.
    zone_id string
    Identifier.
    zoneId String
    Identifier.
    zoneId string
    Identifier.
    zone_id str
    Identifier.
    zoneId String
    Identifier.

    getPrecursor Result

    The following output properties are available:

    DefaultMode string
    The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule. Available values: "off", "min-friction", "max-security".
    EnforcementRules List<GetPrecursorEnforcementRule>
    The ordered list of enforcement rules for the zone.
    Id string
    Identifier.
    ZoneId string
    Identifier.
    DefaultMode string
    The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule. Available values: "off", "min-friction", "max-security".
    EnforcementRules []GetPrecursorEnforcementRule
    The ordered list of enforcement rules for the zone.
    Id string
    Identifier.
    ZoneId string
    Identifier.
    default_mode string
    The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule. Available values: "off", "min-friction", "max-security".
    enforcement_rules list(object)
    The ordered list of enforcement rules for the zone.
    id string
    Identifier.
    zone_id string
    Identifier.
    defaultMode String
    The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule. Available values: "off", "min-friction", "max-security".
    enforcementRules List<GetPrecursorEnforcementRule>
    The ordered list of enforcement rules for the zone.
    id String
    Identifier.
    zoneId String
    Identifier.
    defaultMode string
    The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule. Available values: "off", "min-friction", "max-security".
    enforcementRules GetPrecursorEnforcementRule[]
    The ordered list of enforcement rules for the zone.
    id string
    Identifier.
    zoneId string
    Identifier.
    default_mode str
    The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule. Available values: "off", "min-friction", "max-security".
    enforcement_rules Sequence[GetPrecursorEnforcementRule]
    The ordered list of enforcement rules for the zone.
    id str
    Identifier.
    zone_id str
    Identifier.
    defaultMode String
    The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule. Available values: "off", "min-friction", "max-security".
    enforcementRules List<Property Map>
    The ordered list of enforcement rules for the zone.
    id String
    Identifier.
    zoneId String
    Identifier.

    Supporting Types

    GetPrecursorEnforcementRule

    Description string
    An informative description of the rule.
    Enabled bool
    Whether the rule is active.
    Expression string
    The filter expression that determines which requests the rule matches.
    Id string
    The read-only identifier that Cloudflare assigns to the rule.
    Mode string
    The override mode Precursor applies to requests matching an enforcement rule. Unlike defaultMode, this cannot be off. Available values: "min-friction", "max-security".
    Description string
    An informative description of the rule.
    Enabled bool
    Whether the rule is active.
    Expression string
    The filter expression that determines which requests the rule matches.
    Id string
    The read-only identifier that Cloudflare assigns to the rule.
    Mode string
    The override mode Precursor applies to requests matching an enforcement rule. Unlike defaultMode, this cannot be off. Available values: "min-friction", "max-security".
    description string
    An informative description of the rule.
    enabled bool
    Whether the rule is active.
    expression string
    The filter expression that determines which requests the rule matches.
    id string
    The read-only identifier that Cloudflare assigns to the rule.
    mode string
    The override mode Precursor applies to requests matching an enforcement rule. Unlike defaultMode, this cannot be off. Available values: "min-friction", "max-security".
    description String
    An informative description of the rule.
    enabled Boolean
    Whether the rule is active.
    expression String
    The filter expression that determines which requests the rule matches.
    id String
    The read-only identifier that Cloudflare assigns to the rule.
    mode String
    The override mode Precursor applies to requests matching an enforcement rule. Unlike defaultMode, this cannot be off. Available values: "min-friction", "max-security".
    description string
    An informative description of the rule.
    enabled boolean
    Whether the rule is active.
    expression string
    The filter expression that determines which requests the rule matches.
    id string
    The read-only identifier that Cloudflare assigns to the rule.
    mode string
    The override mode Precursor applies to requests matching an enforcement rule. Unlike defaultMode, this cannot be off. Available values: "min-friction", "max-security".
    description str
    An informative description of the rule.
    enabled bool
    Whether the rule is active.
    expression str
    The filter expression that determines which requests the rule matches.
    id str
    The read-only identifier that Cloudflare assigns to the rule.
    mode str
    The override mode Precursor applies to requests matching an enforcement rule. Unlike defaultMode, this cannot be off. Available values: "min-friction", "max-security".
    description String
    An informative description of the rule.
    enabled Boolean
    Whether the rule is active.
    expression String
    The filter expression that determines which requests the rule matches.
    id String
    The read-only identifier that Cloudflare assigns to the rule.
    mode String
    The override mode Precursor applies to requests matching an enforcement rule. Unlike defaultMode, this cannot be off. Available values: "min-friction", "max-security".

    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 logo
    Viewing docs for Cloudflare v6.20.0
    published on Tuesday, Aug 25, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial