cloudflare.List
Explore with Pulumi AI
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)
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:
- Account
Id 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<List
Item> - The items in the list. If set, this overwrites all items in the list. Do not use with
cloudflare.ListItem
.
- Account
Id 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
Item Type Args - The items in the list. If set, this overwrites all items in the list. Do not use with
cloudflare.ListItem
.
- account
Id 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<List
Item> - The items in the list. If set, this overwrites all items in the list. Do not use with
cloudflare.ListItem
.
- account
Id 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
Item[] - 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[List
Item Args] - The items in the list. If set, this overwrites all items in the list. Do not use with
cloudflare.ListItem
.
- account
Id 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:
- Created
On string - The RFC 3339 timestamp of when the list was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - The RFC 3339 timestamp of when the list was last modified.
- Num
Items double - The number of items in the list.
- Num
Referencing doubleFilters - The number of filters referencing the list.
- Created
On string - The RFC 3339 timestamp of when the list was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - The RFC 3339 timestamp of when the list was last modified.
- Num
Items float64 - The number of items in the list.
- Num
Referencing float64Filters - The number of filters referencing the list.
- created
On String - The RFC 3339 timestamp of when the list was created.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - The RFC 3339 timestamp of when the list was last modified.
- num
Items Double - The number of items in the list.
- num
Referencing DoubleFilters - The number of filters referencing the list.
- created
On string - The RFC 3339 timestamp of when the list was created.
- id string
- The provider-assigned unique ID for this managed resource.
- modified
On string - The RFC 3339 timestamp of when the list was last modified.
- num
Items number - The number of items in the list.
- num
Referencing numberFilters - 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_ floatfilters - The number of filters referencing the list.
- created
On String - The RFC 3339 timestamp of when the list was created.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - The RFC 3339 timestamp of when the list was last modified.
- num
Items Number - The number of items in the list.
- num
Referencing NumberFilters - 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.
- Account
Id string - The Account ID for this resource.
- Created
On string - The RFC 3339 timestamp of when the list was created.
- Description string
- An informative summary of the list.
- Items
List<List
Item> - 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".
- Modified
On 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.
- Num
Items double - The number of items in the list.
- Num
Referencing doubleFilters - The number of filters referencing the list.
- Account
Id string - The Account ID for this resource.
- Created
On string - The RFC 3339 timestamp of when the list was created.
- Description string
- An informative summary of the list.
- Items
[]List
Item Type Args - 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".
- Modified
On 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.
- Num
Items float64 - The number of items in the list.
- Num
Referencing float64Filters - The number of filters referencing the list.
- account
Id String - The Account ID for this resource.
- created
On String - The RFC 3339 timestamp of when the list was created.
- description String
- An informative summary of the list.
- items
List<List
Item> - 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".
- modified
On 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.
- num
Items Double - The number of items in the list.
- num
Referencing DoubleFilters - The number of filters referencing the list.
- account
Id string - The Account ID for this resource.
- created
On string - The RFC 3339 timestamp of when the list was created.
- description string
- An informative summary of the list.
- items
List
Item[] - 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".
- modified
On 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.
- num
Items number - The number of items in the list.
- num
Referencing numberFilters - 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[List
Item Args] - 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_ floatfilters - The number of filters referencing the list.
- account
Id String - The Account ID for this resource.
- created
On 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".
- modified
On 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.
- num
Items Number - The number of items in the list.
- num
Referencing NumberFilters - 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
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, an IPv6 address, or an IPv6 CIDR.
- Redirect
List
Item Redirect - The definition of the redirect.
- 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, an IPv6 address, or an IPv6 CIDR.
- Redirect
List
Item Redirect - The definition of the redirect.
- 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, an IPv6 address, or an IPv6 CIDR.
- redirect
List
Item Redirect - The definition of the redirect.
- 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, an IPv6 address, or an IPv6 CIDR.
- redirect
List
Item Redirect - The definition of the redirect.
- asn int
- A non-negative 32 bit integer
- comment str
- 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 str
- An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.
- redirect
List
Item Redirect - 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
- Url
Hostname string - Exclude
Exact boolHostname - 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 string - Exclude
Exact boolHostname - 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 String - exclude
Exact BooleanHostname - 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 string - exclude
Exact booleanHostname - 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_ boolhostname - 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 String - exclude
Exact BooleanHostname - 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
- 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
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.