cloudflare.ListItem
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleListItem = new cloudflare.ListItem("example_list_item", {
accountId: "023e105f4ecef8ad9ca31a8372d0c353",
listId: "2c0fc9fa937b11eaa1b71c4d701ab86e",
ip: "10.0.0.1",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_list_item = cloudflare.ListItem("example_list_item",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
list_id="2c0fc9fa937b11eaa1b71c4d701ab86e",
ip="10.0.0.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.NewListItem(ctx, "example_list_item", &cloudflare.ListItemArgs{
AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
ListId: pulumi.String("2c0fc9fa937b11eaa1b71c4d701ab86e"),
Ip: pulumi.String("10.0.0.1"),
})
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 exampleListItem = new Cloudflare.ListItem("example_list_item", new()
{
AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
ListId = "2c0fc9fa937b11eaa1b71c4d701ab86e",
Ip = "10.0.0.1",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.ListItem;
import com.pulumi.cloudflare.ListItemArgs;
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) {
var exampleListItem = new ListItem("exampleListItem", ListItemArgs.builder()
.accountId("023e105f4ecef8ad9ca31a8372d0c353")
.listId("2c0fc9fa937b11eaa1b71c4d701ab86e")
.ip("10.0.0.1")
.build());
}
}
resources:
exampleListItem:
type: cloudflare:ListItem
name: example_list_item
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
listId: 2c0fc9fa937b11eaa1b71c4d701ab86e
ip: 10.0.0.1
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: ListItemArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ListItem(resource_name: str,
opts: Optional[ResourceOptions] = None,
list_id: Optional[str] = None,
account_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 ListItemArgs
- 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()
{
ListId = "string",
AccountId = "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{
ListId: pulumi.String("string"),
AccountId: 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()
.listId("string")
.accountId("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",
list_id="string",
account_id="string",
asn=0,
comment="string",
hostname={
"url_hostname": "string",
},
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 listItemResource = new cloudflare.ListItem("listItemResource", {
listId: "string",
accountId: "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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ListItem resource accepts the following input properties:
- List
Id string - The unique ID of the list.
- Account
Id string - Identifier
- Asn int
- A non-negative 32 bit integer
- Comment string
- An informative summary of the list item.
- Hostname
List
Item Hostname - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- Redirect
List
Item Redirect - The definition of the redirect.
- List
Id string - The unique ID of the list.
- Account
Id string - Identifier
- Asn int
- A non-negative 32 bit integer
- Comment string
- An informative summary of the list item.
- Hostname
List
Item Hostname Args - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- Redirect
List
Item Redirect Args - The definition of the redirect.
- list
Id String - The unique ID of the list.
- account
Id String - Identifier
- asn Integer
- A non-negative 32 bit integer
- comment String
- An informative summary of the list item.
- hostname
List
Item Hostname - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- redirect
List
Item Redirect - The definition of the redirect.
- list
Id string - The unique ID of the list.
- account
Id string - Identifier
- asn number
- A non-negative 32 bit integer
- comment string
- An informative summary of the list item.
- hostname
List
Item Hostname - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- redirect
List
Item Redirect - The definition of the redirect.
- list_
id str - The unique ID of the list.
- account_
id str - Identifier
- asn int
- A non-negative 32 bit integer
- comment str
- An informative summary of the list item.
- hostname
List
Item Hostname Args - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- redirect
List
Item Redirect Args - The definition of the redirect.
- list
Id String - The unique ID of the list.
- account
Id String - Identifier
- 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- redirect Property Map
- The definition of the redirect.
Outputs
All input properties are implicitly available as output properties. Additionally, the ListItem resource produces the following output properties:
- Created
On string - The RFC 3339 timestamp of when the item was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - The RFC 3339 timestamp of when the item was last modified.
- Operation
Id string - The unique operation ID of the asynchronous action.
- Created
On string - The RFC 3339 timestamp of when the item was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - The RFC 3339 timestamp of when the item was last modified.
- Operation
Id string - The unique operation ID of the asynchronous action.
- created
On String - The RFC 3339 timestamp of when the item was created.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - The RFC 3339 timestamp of when the item was last modified.
- operation
Id String - The unique operation ID of the asynchronous action.
- created
On string - The RFC 3339 timestamp of when the item was created.
- id string
- The provider-assigned unique ID for this managed resource.
- modified
On string - The RFC 3339 timestamp of when the item was last modified.
- operation
Id string - The unique operation ID of the asynchronous action.
- created_
on str - The RFC 3339 timestamp of when the item was created.
- id str
- The provider-assigned unique ID for this managed resource.
- modified_
on str - The RFC 3339 timestamp of when the item was last modified.
- operation_
id str - The unique operation ID of the asynchronous action.
- created
On String - The RFC 3339 timestamp of when the item was created.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - The RFC 3339 timestamp of when the item was last modified.
- operation
Id String - The unique operation ID of the asynchronous action.
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,
created_on: Optional[str] = None,
hostname: Optional[ListItemHostnameArgs] = None,
ip: Optional[str] = None,
list_id: Optional[str] = None,
modified_on: Optional[str] = None,
operation_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)
resources: _: type: cloudflare:ListItem 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.
- Account
Id string - Identifier
- Asn int
- A non-negative 32 bit integer
- Comment string
- An informative summary of the list item.
- Created
On string - The RFC 3339 timestamp of when the item was created.
- Hostname
List
Item Hostname - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- List
Id string - The unique ID of the list.
- Modified
On string - The RFC 3339 timestamp of when the item was last modified.
- Operation
Id string - The unique operation ID of the asynchronous action.
- Redirect
List
Item Redirect - The definition of the redirect.
- Account
Id string - Identifier
- Asn int
- A non-negative 32 bit integer
- Comment string
- An informative summary of the list item.
- Created
On string - The RFC 3339 timestamp of when the item was created.
- Hostname
List
Item Hostname Args - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- List
Id string - The unique ID of the list.
- Modified
On string - The RFC 3339 timestamp of when the item was last modified.
- Operation
Id string - The unique operation ID of the asynchronous action.
- Redirect
List
Item Redirect Args - The definition of the redirect.
- account
Id String - Identifier
- asn Integer
- A non-negative 32 bit integer
- comment String
- An informative summary of the list item.
- created
On String - The RFC 3339 timestamp of when the item was created.
- hostname
List
Item Hostname - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- list
Id String - The unique ID of the list.
- modified
On String - The RFC 3339 timestamp of when the item was last modified.
- operation
Id String - The unique operation ID of the asynchronous action.
- redirect
List
Item Redirect - The definition of the redirect.
- account
Id string - Identifier
- asn number
- A non-negative 32 bit integer
- comment string
- An informative summary of the list item.
- created
On string - The RFC 3339 timestamp of when the item was created.
- hostname
List
Item Hostname - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- list
Id string - The unique ID of the list.
- modified
On string - The RFC 3339 timestamp of when the item was last modified.
- operation
Id string - The unique operation ID of the asynchronous action.
- redirect
List
Item Redirect - The definition of the redirect.
- account_
id str - Identifier
- asn int
- A non-negative 32 bit integer
- comment str
- An informative summary of the list item.
- created_
on str - The RFC 3339 timestamp of when the item was created.
- hostname
List
Item Hostname Args - 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, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- list_
id str - The unique ID of the list.
- modified_
on str - The RFC 3339 timestamp of when the item was last modified.
- operation_
id str - The unique operation ID of the asynchronous action.
- redirect
List
Item Redirect Args - The definition of the redirect.
- account
Id String - Identifier
- asn Number
- A non-negative 32 bit integer
- comment String
- An informative summary of the list item.
- created
On 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 (-).
- ip String
- An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
- list
Id String - The unique ID of the list.
- modified
On String - The RFC 3339 timestamp of when the item was last modified.
- operation
Id String - The unique operation ID of the asynchronous action.
- redirect Property Map
- The definition of the redirect.
Supporting Types
ListItemHostname, ListItemHostnameArgs
- Url
Hostname string
- Url
Hostname string
- url
Hostname String
- url
Hostname string
- url_
hostname str
- url
Hostname String
ListItemRedirect, ListItemRedirectArgs
- Source
Url string - Target
Url string - Include
Subdomains bool - Preserve
Path boolSuffix - Preserve
Query boolString - Status
Code int - Available values: 301, 302, 307, 308.
- Subpath
Matching bool
- Source
Url string - Target
Url string - Include
Subdomains bool - Preserve
Path boolSuffix - Preserve
Query boolString - Status
Code int - Available values: 301, 302, 307, 308.
- Subpath
Matching bool
- source
Url String - target
Url String - include
Subdomains Boolean - preserve
Path BooleanSuffix - preserve
Query BooleanString - status
Code Integer - Available values: 301, 302, 307, 308.
- subpath
Matching Boolean
- source
Url string - target
Url string - include
Subdomains boolean - preserve
Path booleanSuffix - preserve
Query booleanString - status
Code number - Available values: 301, 302, 307, 308.
- subpath
Matching boolean
- source_
url str - target_
url str - include_
subdomains bool - preserve_
path_ boolsuffix - preserve_
query_ boolstring - status_
code int - Available values: 301, 302, 307, 308.
- subpath_
matching bool
- source
Url String - target
Url String - include
Subdomains Boolean - preserve
Path BooleanSuffix - preserve
Query BooleanString - status
Code Number - Available values: 301, 302, 307, 308.
- subpath
Matching Boolean
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.