1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. List
Cloudflare v6.9.1 published on Thursday, Sep 18, 2025 by Pulumi

cloudflare.List

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.9.1 published on Thursday, Sep 18, 2025 by Pulumi

    Example Usage

    Create List Resource

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

    Constructor syntax

    new List(name: string, args: ListArgs, opts?: CustomResourceOptions);
    @overload
    def List(resource_name: str,
             args: ListArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def List(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             account_id: Optional[str] = None,
             kind: Optional[str] = None,
             name: Optional[str] = None,
             description: Optional[str] = None,
             items: Optional[Sequence[ListItemArgs]] = None)
    func NewList(ctx *Context, name string, args ListArgs, opts ...ResourceOption) (*List, error)
    public List(string name, ListArgs args, CustomResourceOptions? opts = null)
    public List(String name, ListArgs args)
    public List(String name, ListArgs args, CustomResourceOptions options)
    
    type: cloudflare:List
    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 ListArgs
    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 ListArgs
    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 ListArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ListArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ListArgs
    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 listResource = new Cloudflare.List("listResource", new()
    {
        AccountId = "string",
        Kind = "string",
        Name = "string",
        Description = "string",
        Items = new[]
        {
            new Cloudflare.Inputs.ListItemArgs
            {
                Asn = 0,
                Comment = "string",
                Hostname = new Cloudflare.Inputs.ListItemHostnameArgs
                {
                    UrlHostname = "string",
                    ExcludeExactHostname = false,
                },
                Ip = "string",
                Redirect = new Cloudflare.Inputs.ListItemRedirectArgs
                {
                    SourceUrl = "string",
                    TargetUrl = "string",
                    IncludeSubdomains = false,
                    PreservePathSuffix = false,
                    PreserveQueryString = false,
                    StatusCode = 0,
                    SubpathMatching = false,
                },
            },
        },
    });
    
    example, err := cloudflare.NewList(ctx, "listResource", &cloudflare.ListArgs{
    	AccountId:   pulumi.String("string"),
    	Kind:        pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Items: cloudflare.ListItemTypeArray{
    		&cloudflare.ListItemTypeArgs{
    			Asn:     pulumi.Int(0),
    			Comment: pulumi.String("string"),
    			Hostname: &cloudflare.ListItemHostnameArgs{
    				UrlHostname:          pulumi.String("string"),
    				ExcludeExactHostname: pulumi.Bool(false),
    			},
    			Ip: pulumi.String("string"),
    			Redirect: &cloudflare.ListItemRedirectArgs{
    				SourceUrl:           pulumi.String("string"),
    				TargetUrl:           pulumi.String("string"),
    				IncludeSubdomains:   pulumi.Bool(false),
    				PreservePathSuffix:  pulumi.Bool(false),
    				PreserveQueryString: pulumi.Bool(false),
    				StatusCode:          pulumi.Int(0),
    				SubpathMatching:     pulumi.Bool(false),
    			},
    		},
    	},
    })
    
    var listResource = new List("listResource", ListArgs.builder()
        .accountId("string")
        .kind("string")
        .name("string")
        .description("string")
        .items(ListItemArgs.builder()
            .asn(0)
            .comment("string")
            .hostname(ListItemHostnameArgs.builder()
                .urlHostname("string")
                .excludeExactHostname(false)
                .build())
            .ip("string")
            .redirect(ListItemRedirectArgs.builder()
                .sourceUrl("string")
                .targetUrl("string")
                .includeSubdomains(false)
                .preservePathSuffix(false)
                .preserveQueryString(false)
                .statusCode(0)
                .subpathMatching(false)
                .build())
            .build())
        .build());
    
    list_resource = cloudflare.List("listResource",
        account_id="string",
        kind="string",
        name="string",
        description="string",
        items=[{
            "asn": 0,
            "comment": "string",
            "hostname": {
                "url_hostname": "string",
                "exclude_exact_hostname": False,
            },
            "ip": "string",
            "redirect": {
                "source_url": "string",
                "target_url": "string",
                "include_subdomains": False,
                "preserve_path_suffix": False,
                "preserve_query_string": False,
                "status_code": 0,
                "subpath_matching": False,
            },
        }])
    
    const listResource = new cloudflare.List("listResource", {
        accountId: "string",
        kind: "string",
        name: "string",
        description: "string",
        items: [{
            asn: 0,
            comment: "string",
            hostname: {
                urlHostname: "string",
                excludeExactHostname: false,
            },
            ip: "string",
            redirect: {
                sourceUrl: "string",
                targetUrl: "string",
                includeSubdomains: false,
                preservePathSuffix: false,
                preserveQueryString: false,
                statusCode: 0,
                subpathMatching: false,
            },
        }],
    });
    
    type: cloudflare:List
    properties:
        accountId: string
        description: string
        items:
            - asn: 0
              comment: string
              hostname:
                excludeExactHostname: false
                urlHostname: string
              ip: string
              redirect:
                includeSubdomains: false
                preservePathSuffix: false
                preserveQueryString: false
                sourceUrl: string
                statusCode: 0
                subpathMatching: false
                targetUrl: string
        kind: string
        name: string
    

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

    AccountId string
    The Account ID for this resource.
    Kind string
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    Name string
    An informative name for the list. Use this name in filter and rule expressions.
    Description string
    An informative summary of the list.
    Items List<ListItem>
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    AccountId string
    The Account ID for this resource.
    Kind string
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    Name string
    An informative name for the list. Use this name in filter and rule expressions.
    Description string
    An informative summary of the list.
    Items []ListItemTypeArgs
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    accountId String
    The Account ID for this resource.
    kind String
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    name String
    An informative name for the list. Use this name in filter and rule expressions.
    description String
    An informative summary of the list.
    items List<ListItem>
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    accountId string
    The Account ID for this resource.
    kind string
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    name string
    An informative name for the list. Use this name in filter and rule expressions.
    description string
    An informative summary of the list.
    items ListItem[]
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    account_id str
    The Account ID for this resource.
    kind str
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    name str
    An informative name for the list. Use this name in filter and rule expressions.
    description str
    An informative summary of the list.
    items Sequence[ListItemArgs]
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    accountId String
    The Account ID for this resource.
    kind String
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    name String
    An informative name for the list. Use this name in filter and rule expressions.
    description String
    An informative summary of the list.
    items List<Property Map>
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.

    Outputs

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

    CreatedOn string
    The RFC 3339 timestamp of when the list was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    The RFC 3339 timestamp of when the list was last modified.
    NumItems double
    The number of items in the list.
    NumReferencingFilters double
    The number of filters referencing the list.
    CreatedOn string
    The RFC 3339 timestamp of when the list was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    The RFC 3339 timestamp of when the list was last modified.
    NumItems float64
    The number of items in the list.
    NumReferencingFilters float64
    The number of filters referencing the list.
    createdOn String
    The RFC 3339 timestamp of when the list was created.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    The RFC 3339 timestamp of when the list was last modified.
    numItems Double
    The number of items in the list.
    numReferencingFilters Double
    The number of filters referencing the list.
    createdOn string
    The RFC 3339 timestamp of when the list was created.
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedOn string
    The RFC 3339 timestamp of when the list was last modified.
    numItems number
    The number of items in the list.
    numReferencingFilters number
    The number of filters referencing the list.
    created_on str
    The RFC 3339 timestamp of when the list was created.
    id str
    The provider-assigned unique ID for this managed resource.
    modified_on str
    The RFC 3339 timestamp of when the list was last modified.
    num_items float
    The number of items in the list.
    num_referencing_filters float
    The number of filters referencing the list.
    createdOn String
    The RFC 3339 timestamp of when the list was created.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    The RFC 3339 timestamp of when the list was last modified.
    numItems Number
    The number of items in the list.
    numReferencingFilters Number
    The number of filters referencing the list.

    Look up Existing List Resource

    Get an existing List 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?: ListState, opts?: CustomResourceOptions): List
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            created_on: Optional[str] = None,
            description: Optional[str] = None,
            items: Optional[Sequence[ListItemArgs]] = None,
            kind: Optional[str] = None,
            modified_on: Optional[str] = None,
            name: Optional[str] = None,
            num_items: Optional[float] = None,
            num_referencing_filters: Optional[float] = None) -> List
    func GetList(ctx *Context, name string, id IDInput, state *ListState, opts ...ResourceOption) (*List, error)
    public static List Get(string name, Input<string> id, ListState? state, CustomResourceOptions? opts = null)
    public static List get(String name, Output<String> id, ListState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:List    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
    The Account ID for this resource.
    CreatedOn string
    The RFC 3339 timestamp of when the list was created.
    Description string
    An informative summary of the list.
    Items List<ListItem>
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    Kind string
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    ModifiedOn string
    The RFC 3339 timestamp of when the list was last modified.
    Name string
    An informative name for the list. Use this name in filter and rule expressions.
    NumItems double
    The number of items in the list.
    NumReferencingFilters double
    The number of filters referencing the list.
    AccountId string
    The Account ID for this resource.
    CreatedOn string
    The RFC 3339 timestamp of when the list was created.
    Description string
    An informative summary of the list.
    Items []ListItemTypeArgs
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    Kind string
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    ModifiedOn string
    The RFC 3339 timestamp of when the list was last modified.
    Name string
    An informative name for the list. Use this name in filter and rule expressions.
    NumItems float64
    The number of items in the list.
    NumReferencingFilters float64
    The number of filters referencing the list.
    accountId String
    The Account ID for this resource.
    createdOn String
    The RFC 3339 timestamp of when the list was created.
    description String
    An informative summary of the list.
    items List<ListItem>
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    kind String
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    modifiedOn String
    The RFC 3339 timestamp of when the list was last modified.
    name String
    An informative name for the list. Use this name in filter and rule expressions.
    numItems Double
    The number of items in the list.
    numReferencingFilters Double
    The number of filters referencing the list.
    accountId string
    The Account ID for this resource.
    createdOn string
    The RFC 3339 timestamp of when the list was created.
    description string
    An informative summary of the list.
    items ListItem[]
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    kind string
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    modifiedOn string
    The RFC 3339 timestamp of when the list was last modified.
    name string
    An informative name for the list. Use this name in filter and rule expressions.
    numItems number
    The number of items in the list.
    numReferencingFilters number
    The number of filters referencing the list.
    account_id str
    The Account ID for this resource.
    created_on str
    The RFC 3339 timestamp of when the list was created.
    description str
    An informative summary of the list.
    items Sequence[ListItemArgs]
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    kind str
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    modified_on str
    The RFC 3339 timestamp of when the list was last modified.
    name str
    An informative name for the list. Use this name in filter and rule expressions.
    num_items float
    The number of items in the list.
    num_referencing_filters float
    The number of filters referencing the list.
    accountId String
    The Account ID for this resource.
    createdOn String
    The RFC 3339 timestamp of when the list was created.
    description String
    An informative summary of the list.
    items List<Property Map>
    The items in the list. If set, this overwrites all items in the list. Do not use with cloudflare.ListItem.
    kind String
    The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). Available values: "ip", "redirect", "hostname", "asn".
    modifiedOn String
    The RFC 3339 timestamp of when the list was last modified.
    name String
    An informative name for the list. Use this name in filter and rule expressions.
    numItems Number
    The number of items in the list.
    numReferencingFilters Number
    The number of filters referencing the list.

    Supporting Types

    ListItem, ListItemArgs

    Asn int
    A non-negative 32 bit integer
    Comment string
    An informative summary of the list item.
    Hostname ListItemHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    Ip string
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    Redirect ListItemRedirect
    The definition of the redirect.
    Asn int
    A non-negative 32 bit integer
    Comment string
    An informative summary of the list item.
    Hostname ListItemHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    Ip string
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    Redirect ListItemRedirect
    The definition of the redirect.
    asn Integer
    A non-negative 32 bit integer
    comment String
    An informative summary of the list item.
    hostname ListItemHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    ip String
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    redirect ListItemRedirect
    The definition of the redirect.
    asn number
    A non-negative 32 bit integer
    comment string
    An informative summary of the list item.
    hostname ListItemHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    ip string
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    redirect ListItemRedirect
    The definition of the redirect.
    asn int
    A non-negative 32 bit integer
    comment str
    An informative summary of the list item.
    hostname ListItemHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    ip str
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    redirect ListItemRedirect
    The definition of the redirect.
    asn Number
    A non-negative 32 bit integer
    comment String
    An informative summary of the list item.
    hostname Property Map
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    ip String
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    redirect Property Map
    The definition of the redirect.

    ListItemHostname, ListItemHostnameArgs

    UrlHostname string
    ExcludeExactHostname bool
    Only applies to wildcard hostnames (e.g., *.example.com). When true (default), only subdomains are blocked. When false, both the root domain and subdomains are blocked.
    UrlHostname string
    ExcludeExactHostname bool
    Only applies to wildcard hostnames (e.g., *.example.com). When true (default), only subdomains are blocked. When false, both the root domain and subdomains are blocked.
    urlHostname String
    excludeExactHostname Boolean
    Only applies to wildcard hostnames (e.g., *.example.com). When true (default), only subdomains are blocked. When false, both the root domain and subdomains are blocked.
    urlHostname string
    excludeExactHostname boolean
    Only applies to wildcard hostnames (e.g., *.example.com). When true (default), only subdomains are blocked. When false, both the root domain and subdomains are blocked.
    url_hostname str
    exclude_exact_hostname bool
    Only applies to wildcard hostnames (e.g., *.example.com). When true (default), only subdomains are blocked. When false, both the root domain and subdomains are blocked.
    urlHostname String
    excludeExactHostname Boolean
    Only applies to wildcard hostnames (e.g., *.example.com). When true (default), only subdomains are blocked. When false, both the root domain and subdomains are blocked.

    ListItemRedirect, ListItemRedirectArgs

    SourceUrl string
    TargetUrl string
    IncludeSubdomains bool
    PreservePathSuffix bool
    PreserveQueryString bool
    StatusCode int
    Available values: 301, 302, 307, 308.
    SubpathMatching bool
    SourceUrl string
    TargetUrl string
    IncludeSubdomains bool
    PreservePathSuffix bool
    PreserveQueryString bool
    StatusCode int
    Available values: 301, 302, 307, 308.
    SubpathMatching bool
    sourceUrl String
    targetUrl String
    includeSubdomains Boolean
    preservePathSuffix Boolean
    preserveQueryString Boolean
    statusCode Integer
    Available values: 301, 302, 307, 308.
    subpathMatching Boolean
    sourceUrl string
    targetUrl string
    includeSubdomains boolean
    preservePathSuffix boolean
    preserveQueryString boolean
    statusCode number
    Available values: 301, 302, 307, 308.
    subpathMatching boolean
    sourceUrl String
    targetUrl String
    includeSubdomains Boolean
    preservePathSuffix Boolean
    preserveQueryString Boolean
    statusCode Number
    Available values: 301, 302, 307, 308.
    subpathMatching Boolean

    Import

    $ pulumi import cloudflare:index/list:List example '<account_id>/<list_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
    Cloudflare v6.9.1 published on Thursday, Sep 18, 2025 by Pulumi