1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. ListItem
Cloudflare v5.39.1 published on Tuesday, Sep 24, 2024 by Pulumi

cloudflare.ListItem

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.39.1 published on Tuesday, Sep 24, 2024 by Pulumi

    Provides individual list items (IPs, Redirects, ASNs, Hostnames) to be used in Edge Rules Engine across all zones within the same account.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    // IP List
    const exampleIpList = new cloudflare.List("example_ip_list", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        name: "example_list",
        description: "example IPs for a list",
        kind: "ip",
    });
    // IP List Item
    const exampleIpItem = new cloudflare.ListItem("example_ip_item", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        listId: exampleIpList.id,
        comment: "List Item Comment",
        ip: "192.0.2.0",
    });
    // Redirect List
    const exampleRedirectList = new cloudflare.List("example_redirect_list", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        name: "example_list",
        description: "example Redirects for a list",
        kind: "redirect",
    });
    // Redirect List Item
    const exampleRedirectItem = new cloudflare.ListItem("example_redirect_item", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        listId: exampleIpList.id,
        redirect: {
            sourceUrl: "https://source.tld/",
            targetUrl: "https://target.tld",
            statusCode: 302,
            subpathMatching: true,
        },
    });
    // ASN List
    const exampleAsnList = new cloudflare.List("example_asn_list", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        name: "example_asn_list",
        description: "example ASNs for a list",
        kind: "asn",
    });
    // ASN List Item
    const exampleAsnItem = new cloudflare.ListItem("example_asn_item", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        listId: exampleAsnList.id,
        comment: "List Item Comment",
        asn: 6789,
    });
    // Hostname List
    const exampleHostnameList = new cloudflare.List("example_hostname_list", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        name: "example_hostname_list",
        description: "example Hostnames for a list",
        kind: "hostname",
    });
    // Hostname List Item
    const exampleHostnameItem = new cloudflare.ListItem("example_hostname_item", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        listId: exampleHostnameList.id,
        comment: "List Item Comment",
        hostname: {
            urlHostname: "example.com",
        },
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    # IP List
    example_ip_list = cloudflare.List("example_ip_list",
        account_id="f037e56e89293a057740de681ac9abbe",
        name="example_list",
        description="example IPs for a list",
        kind="ip")
    # IP List Item
    example_ip_item = cloudflare.ListItem("example_ip_item",
        account_id="f037e56e89293a057740de681ac9abbe",
        list_id=example_ip_list.id,
        comment="List Item Comment",
        ip="192.0.2.0")
    # Redirect List
    example_redirect_list = cloudflare.List("example_redirect_list",
        account_id="f037e56e89293a057740de681ac9abbe",
        name="example_list",
        description="example Redirects for a list",
        kind="redirect")
    # Redirect List Item
    example_redirect_item = cloudflare.ListItem("example_redirect_item",
        account_id="f037e56e89293a057740de681ac9abbe",
        list_id=example_ip_list.id,
        redirect={
            "source_url": "https://source.tld/",
            "target_url": "https://target.tld",
            "status_code": 302,
            "subpath_matching": True,
        })
    # ASN List
    example_asn_list = cloudflare.List("example_asn_list",
        account_id="f037e56e89293a057740de681ac9abbe",
        name="example_asn_list",
        description="example ASNs for a list",
        kind="asn")
    # ASN List Item
    example_asn_item = cloudflare.ListItem("example_asn_item",
        account_id="f037e56e89293a057740de681ac9abbe",
        list_id=example_asn_list.id,
        comment="List Item Comment",
        asn=6789)
    # Hostname List
    example_hostname_list = cloudflare.List("example_hostname_list",
        account_id="f037e56e89293a057740de681ac9abbe",
        name="example_hostname_list",
        description="example Hostnames for a list",
        kind="hostname")
    # Hostname List Item
    example_hostname_item = cloudflare.ListItem("example_hostname_item",
        account_id="f037e56e89293a057740de681ac9abbe",
        list_id=example_hostname_list.id,
        comment="List Item Comment",
        hostname={
            "url_hostname": "example.com",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// IP List
    		exampleIpList, err := cloudflare.NewList(ctx, "example_ip_list", &cloudflare.ListArgs{
    			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			Name:        pulumi.String("example_list"),
    			Description: pulumi.String("example IPs for a list"),
    			Kind:        pulumi.String("ip"),
    		})
    		if err != nil {
    			return err
    		}
    		// IP List Item
    		_, err = cloudflare.NewListItem(ctx, "example_ip_item", &cloudflare.ListItemArgs{
    			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			ListId:    exampleIpList.ID(),
    			Comment:   pulumi.String("List Item Comment"),
    			Ip:        pulumi.String("192.0.2.0"),
    		})
    		if err != nil {
    			return err
    		}
    		// Redirect List
    		_, err = cloudflare.NewList(ctx, "example_redirect_list", &cloudflare.ListArgs{
    			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			Name:        pulumi.String("example_list"),
    			Description: pulumi.String("example Redirects for a list"),
    			Kind:        pulumi.String("redirect"),
    		})
    		if err != nil {
    			return err
    		}
    		// Redirect List Item
    		_, err = cloudflare.NewListItem(ctx, "example_redirect_item", &cloudflare.ListItemArgs{
    			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			ListId:    exampleIpList.ID(),
    			Redirect: &cloudflare.ListItemRedirectArgs{
    				SourceUrl:       pulumi.String("https://source.tld/"),
    				TargetUrl:       pulumi.String("https://target.tld"),
    				StatusCode:      pulumi.Int(302),
    				SubpathMatching: pulumi.Bool(true),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// ASN List
    		exampleAsnList, err := cloudflare.NewList(ctx, "example_asn_list", &cloudflare.ListArgs{
    			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			Name:        pulumi.String("example_asn_list"),
    			Description: pulumi.String("example ASNs for a list"),
    			Kind:        pulumi.String("asn"),
    		})
    		if err != nil {
    			return err
    		}
    		// ASN List Item
    		_, err = cloudflare.NewListItem(ctx, "example_asn_item", &cloudflare.ListItemArgs{
    			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			ListId:    exampleAsnList.ID(),
    			Comment:   pulumi.String("List Item Comment"),
    			Asn:       pulumi.Int(6789),
    		})
    		if err != nil {
    			return err
    		}
    		// Hostname List
    		exampleHostnameList, err := cloudflare.NewList(ctx, "example_hostname_list", &cloudflare.ListArgs{
    			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			Name:        pulumi.String("example_hostname_list"),
    			Description: pulumi.String("example Hostnames for a list"),
    			Kind:        pulumi.String("hostname"),
    		})
    		if err != nil {
    			return err
    		}
    		// Hostname List Item
    		_, err = cloudflare.NewListItem(ctx, "example_hostname_item", &cloudflare.ListItemArgs{
    			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			ListId:    exampleHostnameList.ID(),
    			Comment:   pulumi.String("List Item Comment"),
    			Hostname: &cloudflare.ListItemHostnameArgs{
    				UrlHostname: pulumi.String("example.com"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // IP List
        var exampleIpList = new Cloudflare.List("example_ip_list", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            Name = "example_list",
            Description = "example IPs for a list",
            Kind = "ip",
        });
    
        // IP List Item
        var exampleIpItem = new Cloudflare.ListItem("example_ip_item", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            ListId = exampleIpList.Id,
            Comment = "List Item Comment",
            Ip = "192.0.2.0",
        });
    
        // Redirect List
        var exampleRedirectList = new Cloudflare.List("example_redirect_list", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            Name = "example_list",
            Description = "example Redirects for a list",
            Kind = "redirect",
        });
    
        // Redirect List Item
        var exampleRedirectItem = new Cloudflare.ListItem("example_redirect_item", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            ListId = exampleIpList.Id,
            Redirect = new Cloudflare.Inputs.ListItemRedirectArgs
            {
                SourceUrl = "https://source.tld/",
                TargetUrl = "https://target.tld",
                StatusCode = 302,
                SubpathMatching = true,
            },
        });
    
        // ASN List
        var exampleAsnList = new Cloudflare.List("example_asn_list", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            Name = "example_asn_list",
            Description = "example ASNs for a list",
            Kind = "asn",
        });
    
        // ASN List Item
        var exampleAsnItem = new Cloudflare.ListItem("example_asn_item", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            ListId = exampleAsnList.Id,
            Comment = "List Item Comment",
            Asn = 6789,
        });
    
        // Hostname List
        var exampleHostnameList = new Cloudflare.List("example_hostname_list", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            Name = "example_hostname_list",
            Description = "example Hostnames for a list",
            Kind = "hostname",
        });
    
        // Hostname List Item
        var exampleHostnameItem = new Cloudflare.ListItem("example_hostname_item", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            ListId = exampleHostnameList.Id,
            Comment = "List Item Comment",
            Hostname = new Cloudflare.Inputs.ListItemHostnameArgs
            {
                UrlHostname = "example.com",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.List;
    import com.pulumi.cloudflare.ListArgs;
    import com.pulumi.cloudflare.ListItem;
    import com.pulumi.cloudflare.ListItemArgs;
    import com.pulumi.cloudflare.inputs.ListItemRedirectArgs;
    import com.pulumi.cloudflare.inputs.ListItemHostnameArgs;
    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) {
            // IP List
            var exampleIpList = new List("exampleIpList", ListArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .name("example_list")
                .description("example IPs for a list")
                .kind("ip")
                .build());
    
            // IP List Item
            var exampleIpItem = new ListItem("exampleIpItem", ListItemArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .listId(exampleIpList.id())
                .comment("List Item Comment")
                .ip("192.0.2.0")
                .build());
    
            // Redirect List
            var exampleRedirectList = new List("exampleRedirectList", ListArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .name("example_list")
                .description("example Redirects for a list")
                .kind("redirect")
                .build());
    
            // Redirect List Item
            var exampleRedirectItem = new ListItem("exampleRedirectItem", ListItemArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .listId(exampleIpList.id())
                .redirect(ListItemRedirectArgs.builder()
                    .sourceUrl("https://source.tld/")
                    .targetUrl("https://target.tld")
                    .statusCode(302)
                    .subpathMatching(true)
                    .build())
                .build());
    
            // ASN List
            var exampleAsnList = new List("exampleAsnList", ListArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .name("example_asn_list")
                .description("example ASNs for a list")
                .kind("asn")
                .build());
    
            // ASN List Item
            var exampleAsnItem = new ListItem("exampleAsnItem", ListItemArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .listId(exampleAsnList.id())
                .comment("List Item Comment")
                .asn(6789)
                .build());
    
            // Hostname List
            var exampleHostnameList = new List("exampleHostnameList", ListArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .name("example_hostname_list")
                .description("example Hostnames for a list")
                .kind("hostname")
                .build());
    
            // Hostname List Item
            var exampleHostnameItem = new ListItem("exampleHostnameItem", ListItemArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .listId(exampleHostnameList.id())
                .comment("List Item Comment")
                .hostname(ListItemHostnameArgs.builder()
                    .urlHostname("example.com")
                    .build())
                .build());
    
        }
    }
    
    resources:
      # IP List
      exampleIpList:
        type: cloudflare:List
        name: example_ip_list
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          name: example_list
          description: example IPs for a list
          kind: ip
      # IP List Item
      exampleIpItem:
        type: cloudflare:ListItem
        name: example_ip_item
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          listId: ${exampleIpList.id}
          comment: List Item Comment
          ip: 192.0.2.0
      # Redirect List
      exampleRedirectList:
        type: cloudflare:List
        name: example_redirect_list
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          name: example_list
          description: example Redirects for a list
          kind: redirect
      # Redirect List Item
      exampleRedirectItem:
        type: cloudflare:ListItem
        name: example_redirect_item
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          listId: ${exampleIpList.id}
          redirect:
            sourceUrl: https://source.tld/
            targetUrl: https://target.tld
            statusCode: 302
            subpathMatching: true
      # ASN List
      exampleAsnList:
        type: cloudflare:List
        name: example_asn_list
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          name: example_asn_list
          description: example ASNs for a list
          kind: asn
      # ASN List Item
      exampleAsnItem:
        type: cloudflare:ListItem
        name: example_asn_item
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          listId: ${exampleAsnList.id}
          comment: List Item Comment
          asn: 6789
      # Hostname List
      exampleHostnameList:
        type: cloudflare:List
        name: example_hostname_list
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          name: example_hostname_list
          description: example Hostnames for a list
          kind: hostname
      # Hostname List Item
      exampleHostnameItem:
        type: cloudflare:ListItem
        name: example_hostname_item
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          listId: ${exampleHostnameList.id}
          comment: List Item Comment
          hostname:
            urlHostname: example.com
    

    Create ListItem Resource

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

    Constructor syntax

    new ListItem(name: string, args: ListItemArgs, opts?: CustomResourceOptions);
    @overload
    def ListItem(resource_name: str,
                 args: ListItemInitArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def ListItem(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 account_id: Optional[str] = None,
                 list_id: Optional[str] = None,
                 asn: Optional[int] = None,
                 comment: Optional[str] = None,
                 hostname: Optional[ListItemHostnameArgs] = None,
                 ip: Optional[str] = None,
                 redirect: Optional[ListItemRedirectArgs] = None)
    func NewListItem(ctx *Context, name string, args ListItemArgs, opts ...ResourceOption) (*ListItem, error)
    public ListItem(string name, ListItemArgs args, CustomResourceOptions? opts = null)
    public ListItem(String name, ListItemArgs args)
    public ListItem(String name, ListItemArgs args, CustomResourceOptions options)
    
    type: cloudflare:ListItem
    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 ListItemArgs
    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 ListItemInitArgs
    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 ListItemArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ListItemArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ListItemArgs
    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 listItemResource = new Cloudflare.ListItem("listItemResource", new()
    {
        AccountId = "string",
        ListId = "string",
        Asn = 0,
        Comment = "string",
        Hostname = new Cloudflare.Inputs.ListItemHostnameArgs
        {
            UrlHostname = "string",
        },
        Ip = "string",
        Redirect = new Cloudflare.Inputs.ListItemRedirectArgs
        {
            SourceUrl = "string",
            TargetUrl = "string",
            IncludeSubdomains = false,
            PreservePathSuffix = false,
            PreserveQueryString = false,
            StatusCode = 0,
            SubpathMatching = false,
        },
    });
    
    example, err := cloudflare.NewListItem(ctx, "listItemResource", &cloudflare.ListItemArgs{
    	AccountId: pulumi.String("string"),
    	ListId:    pulumi.String("string"),
    	Asn:       pulumi.Int(0),
    	Comment:   pulumi.String("string"),
    	Hostname: &cloudflare.ListItemHostnameArgs{
    		UrlHostname: pulumi.String("string"),
    	},
    	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 listItemResource = new ListItem("listItemResource", ListItemArgs.builder()
        .accountId("string")
        .listId("string")
        .asn(0)
        .comment("string")
        .hostname(ListItemHostnameArgs.builder()
            .urlHostname("string")
            .build())
        .ip("string")
        .redirect(ListItemRedirectArgs.builder()
            .sourceUrl("string")
            .targetUrl("string")
            .includeSubdomains(false)
            .preservePathSuffix(false)
            .preserveQueryString(false)
            .statusCode(0)
            .subpathMatching(false)
            .build())
        .build());
    
    list_item_resource = cloudflare.ListItem("listItemResource",
        account_id="string",
        list_id="string",
        asn=0,
        comment="string",
        hostname=cloudflare.ListItemHostnameArgs(
            url_hostname="string",
        ),
        ip="string",
        redirect=cloudflare.ListItemRedirectArgs(
            source_url="string",
            target_url="string",
            include_subdomains=False,
            preserve_path_suffix=False,
            preserve_query_string=False,
            status_code=0,
            subpath_matching=False,
        ))
    
    const listItemResource = new cloudflare.ListItem("listItemResource", {
        accountId: "string",
        listId: "string",
        asn: 0,
        comment: "string",
        hostname: {
            urlHostname: "string",
        },
        ip: "string",
        redirect: {
            sourceUrl: "string",
            targetUrl: "string",
            includeSubdomains: false,
            preservePathSuffix: false,
            preserveQueryString: false,
            statusCode: 0,
            subpathMatching: false,
        },
    });
    
    type: cloudflare:ListItem
    properties:
        accountId: string
        asn: 0
        comment: string
        hostname:
            urlHostname: string
        ip: string
        listId: string
        redirect:
            includeSubdomains: false
            preservePathSuffix: false
            preserveQueryString: false
            sourceUrl: string
            statusCode: 0
            subpathMatching: false
            targetUrl: string
    

    ListItem Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ListItem resource accepts the following input properties:

    AccountId string
    The account identifier to target for the resource.
    ListId string
    The list identifier to target for the resource.
    Asn int
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    Comment string
    An optional comment for the item.
    Hostname ListItemHostname
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    Ip string
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    Redirect ListItemRedirect
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    AccountId string
    The account identifier to target for the resource.
    ListId string
    The list identifier to target for the resource.
    Asn int
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    Comment string
    An optional comment for the item.
    Hostname ListItemHostnameArgs
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    Ip string
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    Redirect ListItemRedirectArgs
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    accountId String
    The account identifier to target for the resource.
    listId String
    The list identifier to target for the resource.
    asn Integer
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    comment String
    An optional comment for the item.
    hostname ListItemHostname
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    ip String
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    redirect ListItemRedirect
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    accountId string
    The account identifier to target for the resource.
    listId string
    The list identifier to target for the resource.
    asn number
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    comment string
    An optional comment for the item.
    hostname ListItemHostname
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    ip string
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    redirect ListItemRedirect
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    account_id str
    The account identifier to target for the resource.
    list_id str
    The list identifier to target for the resource.
    asn int
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    comment str
    An optional comment for the item.
    hostname ListItemHostnameArgs
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    ip str
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    redirect ListItemRedirectArgs
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    accountId String
    The account identifier to target for the resource.
    listId String
    The list identifier to target for the resource.
    asn Number
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    comment String
    An optional comment for the item.
    hostname Property Map
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    ip String
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    redirect Property Map
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ListItem 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 str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ListItem Resource

    Get an existing ListItem 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?: ListItemState, opts?: CustomResourceOptions): ListItem
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            asn: Optional[int] = None,
            comment: Optional[str] = None,
            hostname: Optional[ListItemHostnameArgs] = None,
            ip: Optional[str] = None,
            list_id: Optional[str] = None,
            redirect: Optional[ListItemRedirectArgs] = None) -> ListItem
    func GetListItem(ctx *Context, name string, id IDInput, state *ListItemState, opts ...ResourceOption) (*ListItem, error)
    public static ListItem Get(string name, Input<string> id, ListItemState? state, CustomResourceOptions? opts = null)
    public static ListItem get(String name, Output<String> id, ListItemState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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 identifier to target for the resource.
    Asn int
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    Comment string
    An optional comment for the item.
    Hostname ListItemHostname
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    Ip string
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    ListId string
    The list identifier to target for the resource.
    Redirect ListItemRedirect
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    AccountId string
    The account identifier to target for the resource.
    Asn int
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    Comment string
    An optional comment for the item.
    Hostname ListItemHostnameArgs
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    Ip string
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    ListId string
    The list identifier to target for the resource.
    Redirect ListItemRedirectArgs
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    accountId String
    The account identifier to target for the resource.
    asn Integer
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    comment String
    An optional comment for the item.
    hostname ListItemHostname
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    ip String
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    listId String
    The list identifier to target for the resource.
    redirect ListItemRedirect
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    accountId string
    The account identifier to target for the resource.
    asn number
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    comment string
    An optional comment for the item.
    hostname ListItemHostname
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    ip string
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    listId string
    The list identifier to target for the resource.
    redirect ListItemRedirect
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    account_id str
    The account identifier to target for the resource.
    asn int
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    comment str
    An optional comment for the item.
    hostname ListItemHostnameArgs
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    ip str
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    list_id str
    The list identifier to target for the resource.
    redirect ListItemRedirectArgs
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    accountId String
    The account identifier to target for the resource.
    asn Number
    Autonomous system number to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    comment String
    An optional comment for the item.
    hostname Property Map
    Hostname to store in the list. Must provide only one of: ip, asn, redirect, hostname.
    ip String
    IP address to include in the list. Must provide only one of: ip, asn, redirect, hostname.
    listId String
    The list identifier to target for the resource.
    redirect Property Map
    Redirect configuration to store in the list. Must provide only one of: ip, asn, redirect, hostname.

    Supporting Types

    ListItemHostname, ListItemHostnameArgs

    UrlHostname string
    The FQDN to match on.
    UrlHostname string
    The FQDN to match on.
    urlHostname String
    The FQDN to match on.
    urlHostname string
    The FQDN to match on.
    url_hostname str
    The FQDN to match on.
    urlHostname String
    The FQDN to match on.

    ListItemRedirect, ListItemRedirectArgs

    SourceUrl string
    The source url of the redirect.
    TargetUrl string
    The target url of the redirect.
    IncludeSubdomains bool
    Whether the redirect also matches subdomains of the source url.
    PreservePathSuffix bool
    Whether the redirect target url should keep the query string of the request's url.
    PreserveQueryString bool
    Whether the redirect target url should keep the query string of the request's url.
    StatusCode int
    The status code to be used when redirecting a request.
    SubpathMatching bool
    Whether the redirect also matches subpaths of the source url.
    SourceUrl string
    The source url of the redirect.
    TargetUrl string
    The target url of the redirect.
    IncludeSubdomains bool
    Whether the redirect also matches subdomains of the source url.
    PreservePathSuffix bool
    Whether the redirect target url should keep the query string of the request's url.
    PreserveQueryString bool
    Whether the redirect target url should keep the query string of the request's url.
    StatusCode int
    The status code to be used when redirecting a request.
    SubpathMatching bool
    Whether the redirect also matches subpaths of the source url.
    sourceUrl String
    The source url of the redirect.
    targetUrl String
    The target url of the redirect.
    includeSubdomains Boolean
    Whether the redirect also matches subdomains of the source url.
    preservePathSuffix Boolean
    Whether the redirect target url should keep the query string of the request's url.
    preserveQueryString Boolean
    Whether the redirect target url should keep the query string of the request's url.
    statusCode Integer
    The status code to be used when redirecting a request.
    subpathMatching Boolean
    Whether the redirect also matches subpaths of the source url.
    sourceUrl string
    The source url of the redirect.
    targetUrl string
    The target url of the redirect.
    includeSubdomains boolean
    Whether the redirect also matches subdomains of the source url.
    preservePathSuffix boolean
    Whether the redirect target url should keep the query string of the request's url.
    preserveQueryString boolean
    Whether the redirect target url should keep the query string of the request's url.
    statusCode number
    The status code to be used when redirecting a request.
    subpathMatching boolean
    Whether the redirect also matches subpaths of the source url.
    source_url str
    The source url of the redirect.
    target_url str
    The target url of the redirect.
    include_subdomains bool
    Whether the redirect also matches subdomains of the source url.
    preserve_path_suffix bool
    Whether the redirect target url should keep the query string of the request's url.
    preserve_query_string bool
    Whether the redirect target url should keep the query string of the request's url.
    status_code int
    The status code to be used when redirecting a request.
    subpath_matching bool
    Whether the redirect also matches subpaths of the source url.
    sourceUrl String
    The source url of the redirect.
    targetUrl String
    The target url of the redirect.
    includeSubdomains Boolean
    Whether the redirect also matches subdomains of the source url.
    preservePathSuffix Boolean
    Whether the redirect target url should keep the query string of the request's url.
    preserveQueryString Boolean
    Whether the redirect target url should keep the query string of the request's url.
    statusCode Number
    The status code to be used when redirecting a request.
    subpathMatching Boolean
    Whether the redirect also matches subpaths of the source url.

    Import

    $ pulumi import cloudflare:index/listItem:ListItem example <account_id>/<list_id>/<item_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 v5.39.1 published on Tuesday, Sep 24, 2024 by Pulumi