1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getListItems
Cloudflare v6.10.0 published on Thursday, Oct 2, 2025 by Pulumi

cloudflare.getListItems

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.10.0 published on Thursday, Oct 2, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleListItems = cloudflare.getListItems({
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        listId: "2c0fc9fa937b11eaa1b71c4d701ab86e",
        perPage: 1,
        search: "1.1.1.",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_list_items = cloudflare.get_list_items(account_id="023e105f4ecef8ad9ca31a8372d0c353",
        list_id="2c0fc9fa937b11eaa1b71c4d701ab86e",
        per_page=1,
        search="1.1.1.")
    
    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.LookupListItems(ctx, &cloudflare.LookupListItemsArgs{
    			AccountId: "023e105f4ecef8ad9ca31a8372d0c353",
    			ListId:    "2c0fc9fa937b11eaa1b71c4d701ab86e",
    			PerPage:   pulumi.IntRef(1),
    			Search:    pulumi.StringRef("1.1.1."),
    		}, 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 exampleListItems = Cloudflare.GetListItems.Invoke(new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            ListId = "2c0fc9fa937b11eaa1b71c4d701ab86e",
            PerPage = 1,
            Search = "1.1.1.",
        });
    
    });
    
    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.GetListItemsArgs;
    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 exampleListItems = CloudflareFunctions.getListItems(GetListItemsArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .listId("2c0fc9fa937b11eaa1b71c4d701ab86e")
                .perPage(1)
                .search("1.1.1.")
                .build());
    
        }
    }
    
    variables:
      exampleListItems:
        fn::invoke:
          function: cloudflare:getListItems
          arguments:
            accountId: 023e105f4ecef8ad9ca31a8372d0c353
            listId: 2c0fc9fa937b11eaa1b71c4d701ab86e
            perPage: 1
            search: 1.1.1.
    

    Using getListItems

    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 getListItems(args: GetListItemsArgs, opts?: InvokeOptions): Promise<GetListItemsResult>
    function getListItemsOutput(args: GetListItemsOutputArgs, opts?: InvokeOptions): Output<GetListItemsResult>
    def get_list_items(account_id: Optional[str] = None,
                       list_id: Optional[str] = None,
                       max_items: Optional[int] = None,
                       per_page: Optional[int] = None,
                       search: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetListItemsResult
    def get_list_items_output(account_id: Optional[pulumi.Input[str]] = None,
                       list_id: Optional[pulumi.Input[str]] = None,
                       max_items: Optional[pulumi.Input[int]] = None,
                       per_page: Optional[pulumi.Input[int]] = None,
                       search: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetListItemsResult]
    func LookupListItems(ctx *Context, args *LookupListItemsArgs, opts ...InvokeOption) (*LookupListItemsResult, error)
    func LookupListItemsOutput(ctx *Context, args *LookupListItemsOutputArgs, opts ...InvokeOption) LookupListItemsResultOutput

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

    public static class GetListItems 
    {
        public static Task<GetListItemsResult> InvokeAsync(GetListItemsArgs args, InvokeOptions? opts = null)
        public static Output<GetListItemsResult> Invoke(GetListItemsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetListItemsResult> getListItems(GetListItemsArgs args, InvokeOptions options)
    public static Output<GetListItemsResult> getListItems(GetListItemsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getListItems:getListItems
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    The Account ID for this resource.
    ListId string
    The unique ID of the list.
    MaxItems int
    Max items to fetch, default: 1000
    PerPage int
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    Search string
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    AccountId string
    The Account ID for this resource.
    ListId string
    The unique ID of the list.
    MaxItems int
    Max items to fetch, default: 1000
    PerPage int
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    Search string
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    accountId String
    The Account ID for this resource.
    listId String
    The unique ID of the list.
    maxItems Integer
    Max items to fetch, default: 1000
    perPage Integer
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    search String
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    accountId string
    The Account ID for this resource.
    listId string
    The unique ID of the list.
    maxItems number
    Max items to fetch, default: 1000
    perPage number
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    search string
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    account_id str
    The Account ID for this resource.
    list_id str
    The unique ID of the list.
    max_items int
    Max items to fetch, default: 1000
    per_page int
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    search str
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    accountId String
    The Account ID for this resource.
    listId String
    The unique ID of the list.
    maxItems Number
    Max items to fetch, default: 1000
    perPage Number
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    search String
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.

    getListItems Result

    The following output properties are available:

    AccountId string
    The Account ID for this resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    ListId string
    The unique ID of the list.
    Results List<GetListItemsResult>
    The items returned by the data source
    MaxItems int
    Max items to fetch, default: 1000
    PerPage int
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    Search string
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    AccountId string
    The Account ID for this resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    ListId string
    The unique ID of the list.
    Results []GetListItemsResult
    The items returned by the data source
    MaxItems int
    Max items to fetch, default: 1000
    PerPage int
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    Search string
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    accountId String
    The Account ID for this resource.
    id String
    The provider-assigned unique ID for this managed resource.
    listId String
    The unique ID of the list.
    results List<GetListItemsResult>
    The items returned by the data source
    maxItems Integer
    Max items to fetch, default: 1000
    perPage Integer
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    search String
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    accountId string
    The Account ID for this resource.
    id string
    The provider-assigned unique ID for this managed resource.
    listId string
    The unique ID of the list.
    results GetListItemsResult[]
    The items returned by the data source
    maxItems number
    Max items to fetch, default: 1000
    perPage number
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    search string
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    account_id str
    The Account ID for this resource.
    id str
    The provider-assigned unique ID for this managed resource.
    list_id str
    The unique ID of the list.
    results Sequence[GetListItemsResult]
    The items returned by the data source
    max_items int
    Max items to fetch, default: 1000
    per_page int
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    search str
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.
    accountId String
    The Account ID for this resource.
    id String
    The provider-assigned unique ID for this managed resource.
    listId String
    The unique ID of the list.
    results List<Property Map>
    The items returned by the data source
    maxItems Number
    Max items to fetch, default: 1000
    perPage Number
    Amount of results to include in each paginated response. A non-negative 32 bit integer.
    search String
    A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.

    Supporting Types

    GetListItemsResult

    Asn int
    Defines a non-negative 32 bit integer.
    Comment string
    Defines an informative summary of the list item.
    CreatedOn string
    The RFC 3339 timestamp of when the item was created.
    Hostname GetListItemsResultHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    Id string
    Defines the unique ID of the item in the List.
    Ip string
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    ModifiedOn string
    The RFC 3339 timestamp of when the item was last modified.
    Redirect GetListItemsResultRedirect
    The definition of the redirect.
    Asn int
    Defines a non-negative 32 bit integer.
    Comment string
    Defines an informative summary of the list item.
    CreatedOn string
    The RFC 3339 timestamp of when the item was created.
    Hostname GetListItemsResultHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    Id string
    Defines the unique ID of the item in the List.
    Ip string
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    ModifiedOn string
    The RFC 3339 timestamp of when the item was last modified.
    Redirect GetListItemsResultRedirect
    The definition of the redirect.
    asn Integer
    Defines a non-negative 32 bit integer.
    comment String
    Defines an informative summary of the list item.
    createdOn String
    The RFC 3339 timestamp of when the item was created.
    hostname GetListItemsResultHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    id String
    Defines the unique ID of the item in the List.
    ip String
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    modifiedOn String
    The RFC 3339 timestamp of when the item was last modified.
    redirect GetListItemsResultRedirect
    The definition of the redirect.
    asn number
    Defines a non-negative 32 bit integer.
    comment string
    Defines an informative summary of the list item.
    createdOn string
    The RFC 3339 timestamp of when the item was created.
    hostname GetListItemsResultHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    id string
    Defines the unique ID of the item in the List.
    ip string
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    modifiedOn string
    The RFC 3339 timestamp of when the item was last modified.
    redirect GetListItemsResultRedirect
    The definition of the redirect.
    asn int
    Defines a non-negative 32 bit integer.
    comment str
    Defines an informative summary of the list item.
    created_on str
    The RFC 3339 timestamp of when the item was created.
    hostname GetListItemsResultHostname
    Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).
    id str
    Defines the unique ID of the item in the List.
    ip str
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    modified_on str
    The RFC 3339 timestamp of when the item was last modified.
    redirect GetListItemsResultRedirect
    The definition of the redirect.
    asn Number
    Defines a non-negative 32 bit integer.
    comment String
    Defines an informative summary of the list item.
    createdOn String
    The RFC 3339 timestamp of when the item was created.
    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 (-).
    id String
    Defines the unique ID of the item in the List.
    ip String
    An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
    modifiedOn String
    The RFC 3339 timestamp of when the item was last modified.
    redirect Property Map
    The definition of the redirect.

    GetListItemsResultHostname

    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.
    urlHostname string
    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.
    url_hostname str
    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

    GetListItemsResultRedirect

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

    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.10.0 published on Thursday, Oct 2, 2025 by Pulumi
      AI Agentic Workflows: Register now