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
        {
            Comment = "string",
            Value = new Cloudflare.Inputs.ListItemValueArgs
            {
                Asn = 0,
                Hostnames = new[]
                {
                    new Cloudflare.Inputs.ListItemValueHostnameArgs
                    {
                        UrlHostname = "string",
                    },
                },
                Ip = "string",
                Redirects = new[]
                {
                    new Cloudflare.Inputs.ListItemValueRedirectArgs
                    {
                        SourceUrl = "string",
                        TargetUrl = "string",
                        IncludeSubdomains = "string",
                        PreservePathSuffix = "string",
                        PreserveQueryString = "string",
                        StatusCode = 0,
                        SubpathMatching = "string",
                    },
                },
            },
        },
    },
});
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{
			Comment: pulumi.String("string"),
			Value: &cloudflare.ListItemValueArgs{
				Asn: pulumi.Int(0),
				Hostnames: cloudflare.ListItemValueHostnameArray{
					&cloudflare.ListItemValueHostnameArgs{
						UrlHostname: pulumi.String("string"),
					},
				},
				Ip: pulumi.String("string"),
				Redirects: cloudflare.ListItemValueRedirectArray{
					&cloudflare.ListItemValueRedirectArgs{
						SourceUrl:           pulumi.String("string"),
						TargetUrl:           pulumi.String("string"),
						IncludeSubdomains:   pulumi.String("string"),
						PreservePathSuffix:  pulumi.String("string"),
						PreserveQueryString: pulumi.String("string"),
						StatusCode:          pulumi.Int(0),
						SubpathMatching:     pulumi.String("string"),
					},
				},
			},
		},
	},
})
var listResource = new List("listResource", ListArgs.builder()
    .accountId("string")
    .kind("string")
    .name("string")
    .description("string")
    .items(ListItemArgs.builder()
        .comment("string")
        .value(ListItemValueArgs.builder()
            .asn(0)
            .hostnames(ListItemValueHostnameArgs.builder()
                .urlHostname("string")
                .build())
            .ip("string")
            .redirects(ListItemValueRedirectArgs.builder()
                .sourceUrl("string")
                .targetUrl("string")
                .includeSubdomains("string")
                .preservePathSuffix("string")
                .preserveQueryString("string")
                .statusCode(0)
                .subpathMatching("string")
                .build())
            .build())
        .build())
    .build());
list_resource = cloudflare.List("listResource",
    account_id="string",
    kind="string",
    name="string",
    description="string",
    items=[{
        "comment": "string",
        "value": {
            "asn": 0,
            "hostnames": [{
                "url_hostname": "string",
            }],
            "ip": "string",
            "redirects": [{
                "source_url": "string",
                "target_url": "string",
                "include_subdomains": "string",
                "preserve_path_suffix": "string",
                "preserve_query_string": "string",
                "status_code": 0,
                "subpath_matching": "string",
            }],
        },
    }])
const listResource = new cloudflare.List("listResource", {
    accountId: "string",
    kind: "string",
    name: "string",
    description: "string",
    items: [{
        comment: "string",
        value: {
            asn: 0,
            hostnames: [{
                urlHostname: "string",
            }],
            ip: "string",
            redirects: [{
                sourceUrl: "string",
                targetUrl: "string",
                includeSubdomains: "string",
                preservePathSuffix: "string",
                preserveQueryString: "string",
                statusCode: 0,
                subpathMatching: "string",
            }],
        },
    }],
});
type: cloudflare:List
properties:
    accountId: string
    description: string
    items:
        - comment: string
          value:
            asn: 0
            hostnames:
                - urlHostname: string
            ip: string
            redirects:
                - includeSubdomains: string
                  preservePathSuffix: string
                  preserveQueryString: string
                  sourceUrl: string
                  statusCode: 0
                  subpathMatching: string
                  targetUrl: string
    kind: string
    name: string
List Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The List resource accepts the following input properties:
- AccountId string
- The account identifier to target for the resource.
- Kind string
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- Name string
- The name of the list.
- Description string
- An optional description of the list.
- Items
List<ListItem> 
- The items in the list.
- AccountId string
- The account identifier to target for the resource.
- Kind string
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- Name string
- The name of the list.
- Description string
- An optional description of the list.
- Items
[]ListItem Type Args 
- The items in the list.
- accountId String
- The account identifier to target for the resource.
- kind String
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- name String
- The name of the list.
- description String
- An optional description of the list.
- items
List<ListItem> 
- The items in the list.
- accountId string
- The account identifier to target for the resource.
- kind string
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- name string
- The name of the list.
- description string
- An optional description of the list.
- items
ListItem[] 
- The items in the list.
- account_id str
- The account identifier to target for the resource.
- kind str
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- name str
- The name of the list.
- description str
- An optional description of the list.
- items
Sequence[ListItem Args] 
- The items in the list.
- accountId String
- The account identifier to target for the resource.
- kind String
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- name String
- The name of the list.
- description String
- An optional description of the list.
- items List<Property Map>
- The items in the list.
Outputs
All input properties are implicitly available as output properties. Additionally, the List 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 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,
        description: Optional[str] = None,
        items: Optional[Sequence[ListItemArgs]] = None,
        kind: Optional[str] = None,
        name: Optional[str] = None) -> Listfunc 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.
- AccountId string
- The account identifier to target for the resource.
- Description string
- An optional description of the list.
- Items
List<ListItem> 
- The items in the list.
- Kind string
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- Name string
- The name of the list.
- AccountId string
- The account identifier to target for the resource.
- Description string
- An optional description of the list.
- Items
[]ListItem Type Args 
- The items in the list.
- Kind string
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- Name string
- The name of the list.
- accountId String
- The account identifier to target for the resource.
- description String
- An optional description of the list.
- items
List<ListItem> 
- The items in the list.
- kind String
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- name String
- The name of the list.
- accountId string
- The account identifier to target for the resource.
- description string
- An optional description of the list.
- items
ListItem[] 
- The items in the list.
- kind string
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- name string
- The name of the list.
- account_id str
- The account identifier to target for the resource.
- description str
- An optional description of the list.
- items
Sequence[ListItem Args] 
- The items in the list.
- kind str
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- name str
- The name of the list.
- accountId String
- The account identifier to target for the resource.
- description String
- An optional description of the list.
- items List<Property Map>
- The items in the list.
- kind String
- The type of items the list will contain. Must provide only one of: ip,redirect,hostname,asn..
- name String
- The name of the list.
Supporting Types
ListItem, ListItemArgs    
- Comment string
- An optional comment for the item.
- Value
ListItem Value 
- Comment string
- An optional comment for the item.
- Value
ListItem Value 
- comment String
- An optional comment for the item.
- value
ListItem Value 
- comment string
- An optional comment for the item.
- value
ListItem Value 
- comment str
- An optional comment for the item.
- value
ListItem Value 
- comment String
- An optional comment for the item.
- value Property Map
ListItemValue, ListItemValueArgs      
- asn Number
- hostnames List<Property Map>
- ip String
- redirects List<Property Map>
ListItemValueHostname, ListItemValueHostnameArgs        
- UrlHostname string
- The FQDN to match on. Wildcard sub-domain matching is allowed. Eg. *.abc.com.
- UrlHostname string
- The FQDN to match on. Wildcard sub-domain matching is allowed. Eg. *.abc.com.
- urlHostname String
- The FQDN to match on. Wildcard sub-domain matching is allowed. Eg. *.abc.com.
- urlHostname string
- The FQDN to match on. Wildcard sub-domain matching is allowed. Eg. *.abc.com.
- url_hostname str
- The FQDN to match on. Wildcard sub-domain matching is allowed. Eg. *.abc.com.
- urlHostname String
- The FQDN to match on. Wildcard sub-domain matching is allowed. Eg. *.abc.com.
ListItemValueRedirect, ListItemValueRedirectArgs        
- SourceUrl string
- The source url of the redirect.
- TargetUrl string
- The target url of the redirect.
- IncludeSubdomains string
- Whether the redirect also matches subdomains of the source url. Available values: disabled,enabled.
- PreservePath stringSuffix 
- Whether to preserve the path suffix when doing subpath matching. Available values: disabled,enabled.
- PreserveQuery stringString 
- Whether the redirect target url should keep the query string of the request's url. Available values: disabled,enabled.
- StatusCode int
- The status code to be used when redirecting a request.
- SubpathMatching string
- Whether the redirect also matches subpaths of the source url. Available values: disabled,enabled.
- SourceUrl string
- The source url of the redirect.
- TargetUrl string
- The target url of the redirect.
- IncludeSubdomains string
- Whether the redirect also matches subdomains of the source url. Available values: disabled,enabled.
- PreservePath stringSuffix 
- Whether to preserve the path suffix when doing subpath matching. Available values: disabled,enabled.
- PreserveQuery stringString 
- Whether the redirect target url should keep the query string of the request's url. Available values: disabled,enabled.
- StatusCode int
- The status code to be used when redirecting a request.
- SubpathMatching string
- Whether the redirect also matches subpaths of the source url. Available values: disabled,enabled.
- sourceUrl String
- The source url of the redirect.
- targetUrl String
- The target url of the redirect.
- includeSubdomains String
- Whether the redirect also matches subdomains of the source url. Available values: disabled,enabled.
- preservePath StringSuffix 
- Whether to preserve the path suffix when doing subpath matching. Available values: disabled,enabled.
- preserveQuery StringString 
- Whether the redirect target url should keep the query string of the request's url. Available values: disabled,enabled.
- statusCode Integer
- The status code to be used when redirecting a request.
- subpathMatching String
- Whether the redirect also matches subpaths of the source url. Available values: disabled,enabled.
- sourceUrl string
- The source url of the redirect.
- targetUrl string
- The target url of the redirect.
- includeSubdomains string
- Whether the redirect also matches subdomains of the source url. Available values: disabled,enabled.
- preservePath stringSuffix 
- Whether to preserve the path suffix when doing subpath matching. Available values: disabled,enabled.
- preserveQuery stringString 
- Whether the redirect target url should keep the query string of the request's url. Available values: disabled,enabled.
- statusCode number
- The status code to be used when redirecting a request.
- subpathMatching string
- Whether the redirect also matches subpaths of the source url. Available values: disabled,enabled.
- source_url str
- The source url of the redirect.
- target_url str
- The target url of the redirect.
- include_subdomains str
- Whether the redirect also matches subdomains of the source url. Available values: disabled,enabled.
- preserve_path_ strsuffix 
- Whether to preserve the path suffix when doing subpath matching. Available values: disabled,enabled.
- preserve_query_ strstring 
- Whether the redirect target url should keep the query string of the request's url. Available values: disabled,enabled.
- status_code int
- The status code to be used when redirecting a request.
- subpath_matching str
- Whether the redirect also matches subpaths of the source url. Available values: disabled,enabled.
- sourceUrl String
- The source url of the redirect.
- targetUrl String
- The target url of the redirect.
- includeSubdomains String
- Whether the redirect also matches subdomains of the source url. Available values: disabled,enabled.
- preservePath StringSuffix 
- Whether to preserve the path suffix when doing subpath matching. Available values: disabled,enabled.
- preserveQuery StringString 
- Whether the redirect target url should keep the query string of the request's url. Available values: disabled,enabled.
- statusCode Number
- The status code to be used when redirecting a request.
- subpathMatching String
- Whether the redirect also matches subpaths of the source url. Available values: disabled,enabled.
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 cloudflareTerraform Provider.