Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

IpList

IP Lists are a set of IP addresses or CIDR ranges that are configured on the account level. Once created, IP Lists can be used in Firewall Rules across all zones within the same account.

Example Usage

using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Cloudflare.IpList("example", new Cloudflare.IpListArgs
        {
            AccountId = "d41d8cd98f00b204e9800998ecf8427e",
            Description = "list description",
            Items = 
            {
                new Cloudflare.Inputs.IpListItemArgs
                {
                    Comment = "Office IP",
                    Value = "192.0.2.1",
                },
                new Cloudflare.Inputs.IpListItemArgs
                {
                    Comment = "Datacenter range",
                    Value = "203.0.113.0/24",
                },
            },
            Kind = "ip",
            Name = "example_list",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-cloudflare/sdk/v2/go/cloudflare"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudflare.NewIpList(ctx, "example", &cloudflare.IpListArgs{
            AccountId:   pulumi.String("d41d8cd98f00b204e9800998ecf8427e"),
            Description: pulumi.String("list description"),
            Items: cloudflare.IpListItemArray{
                &cloudflare.IpListItemArgs{
                    Comment: pulumi.String("Office IP"),
                    Value:   pulumi.String("192.0.2.1"),
                },
                &cloudflare.IpListItemArgs{
                    Comment: pulumi.String("Datacenter range"),
                    Value:   pulumi.String("203.0.113.0/24"),
                },
            },
            Kind: pulumi.String("ip"),
            Name: pulumi.String("example_list"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_cloudflare as cloudflare

example = cloudflare.IpList("example",
    account_id="d41d8cd98f00b204e9800998ecf8427e",
    description="list description",
    items=[
        cloudflare.IpListItemArgs(
            comment="Office IP",
            value="192.0.2.1",
        ),
        cloudflare.IpListItemArgs(
            comment="Datacenter range",
            value="203.0.113.0/24",
        ),
    ],
    kind="ip",
    name="example_list")
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const example = new cloudflare.IpList("example", {
    accountId: "d41d8cd98f00b204e9800998ecf8427e",
    description: "list description",
    items: [
        {
            comment: "Office IP",
            value: "192.0.2.1",
        },
        {
            comment: "Datacenter range",
            value: "203.0.113.0/24",
        },
    ],
    kind: "ip",
    name: "example_list",
});

Create a IpList Resource

new IpList(name: string, args: IpListArgs, opts?: CustomResourceOptions);
def IpList(resource_name: str, opts: Optional[ResourceOptions] = None, account_id: Optional[str] = None, description: Optional[str] = None, items: Optional[Sequence[IpListItemArgs]] = None, kind: Optional[str] = None, name: Optional[str] = None)
func NewIpList(ctx *Context, name string, args IpListArgs, opts ...ResourceOption) (*IpList, error)
public IpList(string name, IpListArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args IpListArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args IpListArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args IpListArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

IpList Resource Properties

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

Inputs

The IpList resource accepts the following input properties:

AccountId string

The ID of the account where the IP List is being created.

Kind string

The kind of values in the List. Valid values: ip.

Name string

The name of the list (used in filter expressions). Valid pattern: ^[a-zA-Z0-9_]+$. Maximum Length: 50

Description string

A note that can be used to annotate the List. Maximum Length: 500

Items List<IpListItemArgs>
AccountId string

The ID of the account where the IP List is being created.

Kind string

The kind of values in the List. Valid values: ip.

Name string

The name of the list (used in filter expressions). Valid pattern: ^[a-zA-Z0-9_]+$. Maximum Length: 50

Description string

A note that can be used to annotate the List. Maximum Length: 500

Items []IpListItem
accountId string

The ID of the account where the IP List is being created.

kind string

The kind of values in the List. Valid values: ip.

name string

The name of the list (used in filter expressions). Valid pattern: ^[a-zA-Z0-9_]+$. Maximum Length: 50

description string

A note that can be used to annotate the List. Maximum Length: 500

items IpListItem[]
account_id str

The ID of the account where the IP List is being created.

kind str

The kind of values in the List. Valid values: ip.

name str

The name of the list (used in filter expressions). Valid pattern: ^[a-zA-Z0-9_]+$. Maximum Length: 50

description str

A note that can be used to annotate the List. Maximum Length: 500

items Sequence[IpListItemArgs]

Outputs

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

Look up an Existing IpList Resource

Get an existing IpList 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?: IpListState, opts?: CustomResourceOptions): IpList
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, account_id: Optional[str] = None, description: Optional[str] = None, items: Optional[Sequence[IpListItemArgs]] = None, kind: Optional[str] = None, name: Optional[str] = None) -> IpList
func GetIpList(ctx *Context, name string, id IDInput, state *IpListState, opts ...ResourceOption) (*IpList, error)
public static IpList Get(string name, Input<string> id, IpListState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AccountId string

The ID of the account where the IP List is being created.

Description string

A note that can be used to annotate the List. Maximum Length: 500

Items List<IpListItemArgs>
Kind string

The kind of values in the List. Valid values: ip.

Name string

The name of the list (used in filter expressions). Valid pattern: ^[a-zA-Z0-9_]+$. Maximum Length: 50

AccountId string

The ID of the account where the IP List is being created.

Description string

A note that can be used to annotate the List. Maximum Length: 500

Items []IpListItem
Kind string

The kind of values in the List. Valid values: ip.

Name string

The name of the list (used in filter expressions). Valid pattern: ^[a-zA-Z0-9_]+$. Maximum Length: 50

accountId string

The ID of the account where the IP List is being created.

description string

A note that can be used to annotate the List. Maximum Length: 500

items IpListItem[]
kind string

The kind of values in the List. Valid values: ip.

name string

The name of the list (used in filter expressions). Valid pattern: ^[a-zA-Z0-9_]+$. Maximum Length: 50

account_id str

The ID of the account where the IP List is being created.

description str

A note that can be used to annotate the List. Maximum Length: 500

items Sequence[IpListItemArgs]
kind str

The kind of values in the List. Valid values: ip.

name str

The name of the list (used in filter expressions). Valid pattern: ^[a-zA-Z0-9_]+$. Maximum Length: 50

Supporting Types

IpListItem

Value string

The IPv4 address, IPv4 CIDR or IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.

Comment string

A note that can be used to annotate the item.

Value string

The IPv4 address, IPv4 CIDR or IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.

Comment string

A note that can be used to annotate the item.

value string

The IPv4 address, IPv4 CIDR or IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.

comment string

A note that can be used to annotate the item.

value str

The IPv4 address, IPv4 CIDR or IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.

comment str

A note that can be used to annotate the item.

Import

An existing IP List can be imported using the account ID and list ID

 $ pulumi import cloudflare:index/ipList:IpList example d41d8cd98f00b204e9800998ecf8427e/cb029e245cfdd66dc8d2e570d5dd3322

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.