1. Registry
  2. Packages
  3. Cloudflare Provider
  4. API Docs
  5. FieldExtractor
Viewing docs for Cloudflare v6.23.1
published on Wednesday, Oct 21, 2026 by Pulumi
cloudflare logo cloudflare logo
Viewing docs for Cloudflare v6.23.1
published on Wednesday, Oct 21, 2026 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleFieldExtractor = new cloudflare.FieldExtractor("example_field_extractor", {
        accountId: "123456",
        extractor: "llm_prompts",
        rules: [{
            fields: [{
                expression: "x",
                name: "x",
            }],
            ref: "x",
            description: "description",
        }],
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_field_extractor = cloudflare.FieldExtractor("example_field_extractor",
        account_id="123456",
        extractor="llm_prompts",
        rules=[{
            "fields": [{
                "expression": "x",
                "name": "x",
            }],
            "ref": "x",
            "description": "description",
        }])
    
    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.NewFieldExtractor(ctx, "example_field_extractor", &cloudflare.FieldExtractorArgs{
    			AccountId: pulumi.String("123456"),
    			Extractor: pulumi.String("llm_prompts"),
    			Rules: cloudflare.FieldExtractorRuleArray{
    				&cloudflare.FieldExtractorRuleArgs{
    					Fields: cloudflare.FieldExtractorRuleFieldArray{
    						&cloudflare.FieldExtractorRuleFieldArgs{
    							Expression: pulumi.String("x"),
    							Name:       pulumi.String("x"),
    						},
    					},
    					Ref:         pulumi.String("x"),
    					Description: pulumi.String("description"),
    				},
    			},
    		})
    		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 exampleFieldExtractor = new Cloudflare.FieldExtractor("example_field_extractor", new()
        {
            AccountId = "123456",
            Extractor = "llm_prompts",
            Rules = new[]
            {
                new Cloudflare.Inputs.FieldExtractorRuleArgs
                {
                    Fields = new[]
                    {
                        new Cloudflare.Inputs.FieldExtractorRuleFieldArgs
                        {
                            Expression = "x",
                            Name = "x",
                        },
                    },
                    Ref = "x",
                    Description = "description",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.FieldExtractor;
    import com.pulumi.cloudflare.FieldExtractorArgs;
    import com.pulumi.cloudflare.inputs.FieldExtractorRuleArgs;
    import com.pulumi.cloudflare.inputs.FieldExtractorRuleFieldArgs;
    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) {
            var exampleFieldExtractor = new FieldExtractor("exampleFieldExtractor", FieldExtractorArgs.builder()
                .accountId("123456")
                .extractor("llm_prompts")
                .rules(FieldExtractorRuleArgs.builder()
                    .fields(FieldExtractorRuleFieldArgs.builder()
                        .expression("x")
                        .name("x")
                        .build())
                    .ref("x")
                    .description("description")
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleFieldExtractor:
        type: cloudflare:FieldExtractor
        name: example_field_extractor
        properties:
          accountId: '123456'
          extractor: llm_prompts
          rules:
            - fields:
                - expression: x
                  name: x
              ref: x
              description: description
    
    terraform {
      required_providers {
        cloudflare = {
          source = "pulumi/cloudflare"
        }
      }
    }
    
    resource "cloudflare_field_extractor" "example_field_extractor" {
      lifecycle {
        create_before_destroy = true
      }
      account_id = "123456"
      extractor  = "llm_prompts"
      rules {
        fields {
          expression = "x"
          name       = "x"
        }
        ref         = "x"
        description = "description"
      }
    }
    

    Create FieldExtractor Resource

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

    Constructor syntax

    new FieldExtractor(name: string, args: FieldExtractorArgs, opts?: CustomResourceOptions);
    @overload
    def FieldExtractor(resource_name: str,
                       args: FieldExtractorArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def FieldExtractor(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       account_id: Optional[str] = None,
                       extractor: Optional[str] = None,
                       rules: Optional[Sequence[FieldExtractorRuleArgs]] = None)
    func NewFieldExtractor(ctx *Context, name string, args FieldExtractorArgs, opts ...ResourceOption) (*FieldExtractor, error)
    public FieldExtractor(string name, FieldExtractorArgs args, CustomResourceOptions? opts = null)
    public FieldExtractor(String name, FieldExtractorArgs args)
    public FieldExtractor(String name, FieldExtractorArgs args, CustomResourceOptions options)
    
    type: cloudflare:FieldExtractor
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "cloudflare_field_extractor" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args FieldExtractorArgs
    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 FieldExtractorArgs
    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 FieldExtractorArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FieldExtractorArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FieldExtractorArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var fieldExtractorResource = new Cloudflare.FieldExtractor("fieldExtractorResource", new()
    {
        AccountId = "string",
        Extractor = "string",
        Rules = new[]
        {
            new Cloudflare.Inputs.FieldExtractorRuleArgs
            {
                Fields = new[]
                {
                    new Cloudflare.Inputs.FieldExtractorRuleFieldArgs
                    {
                        Expression = "string",
                        Name = "string",
                    },
                },
                Ref = "string",
                Description = "string",
            },
        },
    });
    
    example, err := cloudflare.NewFieldExtractor(ctx, "fieldExtractorResource", &cloudflare.FieldExtractorArgs{
    	AccountId: pulumi.String("string"),
    	Extractor: pulumi.String("string"),
    	Rules: cloudflare.FieldExtractorRuleArray{
    		&cloudflare.FieldExtractorRuleArgs{
    			Fields: cloudflare.FieldExtractorRuleFieldArray{
    				&cloudflare.FieldExtractorRuleFieldArgs{
    					Expression: pulumi.String("string"),
    					Name:       pulumi.String("string"),
    				},
    			},
    			Ref:         pulumi.String("string"),
    			Description: pulumi.String("string"),
    		},
    	},
    })
    
    resource "cloudflare_field_extractor" "fieldExtractorResource" {
      lifecycle {
        create_before_destroy = true
      }
      account_id = "string"
      extractor  = "string"
      rules {
        fields {
          expression = "string"
          name       = "string"
        }
        ref         = "string"
        description = "string"
      }
    }
    
    var fieldExtractorResource = new FieldExtractor("fieldExtractorResource", FieldExtractorArgs.builder()
        .accountId("string")
        .extractor("string")
        .rules(FieldExtractorRuleArgs.builder()
            .fields(FieldExtractorRuleFieldArgs.builder()
                .expression("string")
                .name("string")
                .build())
            .ref("string")
            .description("string")
            .build())
        .build());
    
    field_extractor_resource = cloudflare.FieldExtractor("fieldExtractorResource",
        account_id="string",
        extractor="string",
        rules=[{
            "fields": [{
                "expression": "string",
                "name": "string",
            }],
            "ref": "string",
            "description": "string",
        }])
    
    const fieldExtractorResource = new cloudflare.FieldExtractor("fieldExtractorResource", {
        accountId: "string",
        extractor: "string",
        rules: [{
            fields: [{
                expression: "string",
                name: "string",
            }],
            ref: "string",
            description: "string",
        }],
    });
    
    type: cloudflare:FieldExtractor
    properties:
        accountId: string
        extractor: string
        rules:
            - description: string
              fields:
                - expression: string
                  name: string
              ref: string
    

    FieldExtractor 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 FieldExtractor resource accepts the following input properties:

    AccountId string
    Cloudflare account ID.
    Extractor string
    Extractor type.
    Rules List<FieldExtractorRule>
    AccountId string
    Cloudflare account ID.
    Extractor string
    Extractor type.
    Rules []FieldExtractorRuleArgs
    account_id string
    Cloudflare account ID.
    extractor string
    Extractor type.
    rules list(object)
    accountId String
    Cloudflare account ID.
    extractor String
    Extractor type.
    rules List<FieldExtractorRule>
    accountId string
    Cloudflare account ID.
    extractor string
    Extractor type.
    rules FieldExtractorRule[]
    account_id str
    Cloudflare account ID.
    extractor str
    Extractor type.
    rules Sequence[FieldExtractorRuleArgs]
    accountId String
    Cloudflare account ID.
    extractor String
    Extractor type.
    rules List<Property Map>

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing FieldExtractor Resource

    Get an existing FieldExtractor 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?: FieldExtractorState, opts?: CustomResourceOptions): FieldExtractor
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            extractor: Optional[str] = None,
            rules: Optional[Sequence[FieldExtractorRuleArgs]] = None) -> FieldExtractor
    func GetFieldExtractor(ctx *Context, name string, id IDInput, state *FieldExtractorState, opts ...ResourceOption) (*FieldExtractor, error)
    public static FieldExtractor Get(string name, Input<string> id, FieldExtractorState? state, CustomResourceOptions? opts = null)
    public static FieldExtractor get(String name, Output<String> id, FieldExtractorState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:FieldExtractor    get:      id: ${id}
    import {
      to = cloudflare_field_extractor.example
      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
    Cloudflare account ID.
    Extractor string
    Extractor type.
    Rules List<FieldExtractorRule>
    AccountId string
    Cloudflare account ID.
    Extractor string
    Extractor type.
    Rules []FieldExtractorRuleArgs
    account_id string
    Cloudflare account ID.
    extractor string
    Extractor type.
    rules list(object)
    accountId String
    Cloudflare account ID.
    extractor String
    Extractor type.
    rules List<FieldExtractorRule>
    accountId string
    Cloudflare account ID.
    extractor string
    Extractor type.
    rules FieldExtractorRule[]
    account_id str
    Cloudflare account ID.
    extractor str
    Extractor type.
    rules Sequence[FieldExtractorRuleArgs]
    accountId String
    Cloudflare account ID.
    extractor String
    Extractor type.
    rules List<Property Map>

    Supporting Types

    FieldExtractorRule, FieldExtractorRuleArgs

    FieldExtractorRuleField, FieldExtractorRuleFieldArgs

    Expression string
    Name string
    Expression string
    Name string
    expression string
    name string
    expression String
    name String
    expression string
    name string
    expression String
    name String

    Import

    $ pulumi import cloudflare:index/fieldExtractor:FieldExtractor example '<account_id>/<extractor>'
    

    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 cloudflare logo
    Viewing docs for Cloudflare v6.23.1
    published on Wednesday, Oct 21, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial