1. Packages
  2. AWS
  3. API Docs
  4. wafregional
  5. IpSet
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.wafregional.IpSet

Explore with Pulumi AI

Provides a WAF Regional IPSet Resource for use with Application Load Balancer.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ipset = new aws.wafregional.IpSet("ipset", {
    name: "tfIPSet",
    ipSetDescriptors: [
        {
            type: "IPV4",
            value: "192.0.7.0/24",
        },
        {
            type: "IPV4",
            value: "10.16.16.0/16",
        },
    ],
});
Copy
import pulumi
import pulumi_aws as aws

ipset = aws.wafregional.IpSet("ipset",
    name="tfIPSet",
    ip_set_descriptors=[
        {
            "type": "IPV4",
            "value": "192.0.7.0/24",
        },
        {
            "type": "IPV4",
            "value": "10.16.16.0/16",
        },
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/wafregional"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := wafregional.NewIpSet(ctx, "ipset", &wafregional.IpSetArgs{
			Name: pulumi.String("tfIPSet"),
			IpSetDescriptors: wafregional.IpSetIpSetDescriptorArray{
				&wafregional.IpSetIpSetDescriptorArgs{
					Type:  pulumi.String("IPV4"),
					Value: pulumi.String("192.0.7.0/24"),
				},
				&wafregional.IpSetIpSetDescriptorArgs{
					Type:  pulumi.String("IPV4"),
					Value: pulumi.String("10.16.16.0/16"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var ipset = new Aws.WafRegional.IpSet("ipset", new()
    {
        Name = "tfIPSet",
        IpSetDescriptors = new[]
        {
            new Aws.WafRegional.Inputs.IpSetIpSetDescriptorArgs
            {
                Type = "IPV4",
                Value = "192.0.7.0/24",
            },
            new Aws.WafRegional.Inputs.IpSetIpSetDescriptorArgs
            {
                Type = "IPV4",
                Value = "10.16.16.0/16",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.wafregional.IpSet;
import com.pulumi.aws.wafregional.IpSetArgs;
import com.pulumi.aws.wafregional.inputs.IpSetIpSetDescriptorArgs;
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 ipset = new IpSet("ipset", IpSetArgs.builder()
            .name("tfIPSet")
            .ipSetDescriptors(            
                IpSetIpSetDescriptorArgs.builder()
                    .type("IPV4")
                    .value("192.0.7.0/24")
                    .build(),
                IpSetIpSetDescriptorArgs.builder()
                    .type("IPV4")
                    .value("10.16.16.0/16")
                    .build())
            .build());

    }
}
Copy
resources:
  ipset:
    type: aws:wafregional:IpSet
    properties:
      name: tfIPSet
      ipSetDescriptors:
        - type: IPV4
          value: 192.0.7.0/24
        - type: IPV4
          value: 10.16.16.0/16
Copy

Create IpSet Resource

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

Constructor syntax

new IpSet(name: string, args?: IpSetArgs, opts?: CustomResourceOptions);
@overload
def IpSet(resource_name: str,
          args: Optional[IpSetArgs] = None,
          opts: Optional[ResourceOptions] = None)

@overload
def IpSet(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          ip_set_descriptors: Optional[Sequence[IpSetIpSetDescriptorArgs]] = None,
          name: Optional[str] = None)
func NewIpSet(ctx *Context, name string, args *IpSetArgs, opts ...ResourceOption) (*IpSet, error)
public IpSet(string name, IpSetArgs? args = null, CustomResourceOptions? opts = null)
public IpSet(String name, IpSetArgs args)
public IpSet(String name, IpSetArgs args, CustomResourceOptions options)
type: aws:wafregional:IpSet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args IpSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args IpSetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args IpSetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args IpSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. IpSetArgs
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 awsIpSetResource = new Aws.WafRegional.IpSet("awsIpSetResource", new()
{
    IpSetDescriptors = new[]
    {
        new Aws.WafRegional.Inputs.IpSetIpSetDescriptorArgs
        {
            Type = "string",
            Value = "string",
        },
    },
    Name = "string",
});
Copy
example, err := wafregional.NewIpSet(ctx, "awsIpSetResource", &wafregional.IpSetArgs{
	IpSetDescriptors: wafregional.IpSetIpSetDescriptorArray{
		&wafregional.IpSetIpSetDescriptorArgs{
			Type:  pulumi.String("string"),
			Value: pulumi.String("string"),
		},
	},
	Name: pulumi.String("string"),
})
Copy
var awsIpSetResource = new IpSet("awsIpSetResource", IpSetArgs.builder()
    .ipSetDescriptors(IpSetIpSetDescriptorArgs.builder()
        .type("string")
        .value("string")
        .build())
    .name("string")
    .build());
Copy
aws_ip_set_resource = aws.wafregional.IpSet("awsIpSetResource",
    ip_set_descriptors=[{
        "type": "string",
        "value": "string",
    }],
    name="string")
Copy
const awsIpSetResource = new aws.wafregional.IpSet("awsIpSetResource", {
    ipSetDescriptors: [{
        type: "string",
        value: "string",
    }],
    name: "string",
});
Copy
type: aws:wafregional:IpSet
properties:
    ipSetDescriptors:
        - type: string
          value: string
    name: string
Copy

IpSet 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 IpSet resource accepts the following input properties:

IpSetDescriptors List<IpSetIpSetDescriptor>
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
Name Changes to this property will trigger replacement. string
The name or description of the IPSet.
IpSetDescriptors []IpSetIpSetDescriptorArgs
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
Name Changes to this property will trigger replacement. string
The name or description of the IPSet.
ipSetDescriptors List<IpSetIpSetDescriptor>
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
name Changes to this property will trigger replacement. String
The name or description of the IPSet.
ipSetDescriptors IpSetIpSetDescriptor[]
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
name Changes to this property will trigger replacement. string
The name or description of the IPSet.
ip_set_descriptors Sequence[IpSetIpSetDescriptorArgs]
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
name Changes to this property will trigger replacement. str
The name or description of the IPSet.
ipSetDescriptors List<Property Map>
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
name Changes to this property will trigger replacement. String
The name or description of the IPSet.

Outputs

All input properties are implicitly available as output properties. Additionally, the IpSet resource produces the following output properties:

Arn string
The ARN of the WAF IPSet.
Id string
The provider-assigned unique ID for this managed resource.
Arn string
The ARN of the WAF IPSet.
Id string
The provider-assigned unique ID for this managed resource.
arn String
The ARN of the WAF IPSet.
id String
The provider-assigned unique ID for this managed resource.
arn string
The ARN of the WAF IPSet.
id string
The provider-assigned unique ID for this managed resource.
arn str
The ARN of the WAF IPSet.
id str
The provider-assigned unique ID for this managed resource.
arn String
The ARN of the WAF IPSet.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing IpSet Resource

Get an existing IpSet 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?: IpSetState, opts?: CustomResourceOptions): IpSet
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        ip_set_descriptors: Optional[Sequence[IpSetIpSetDescriptorArgs]] = None,
        name: Optional[str] = None) -> IpSet
func GetIpSet(ctx *Context, name string, id IDInput, state *IpSetState, opts ...ResourceOption) (*IpSet, error)
public static IpSet Get(string name, Input<string> id, IpSetState? state, CustomResourceOptions? opts = null)
public static IpSet get(String name, Output<String> id, IpSetState state, CustomResourceOptions options)
resources:  _:    type: aws:wafregional:IpSet    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Arn string
The ARN of the WAF IPSet.
IpSetDescriptors List<IpSetIpSetDescriptor>
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
Name Changes to this property will trigger replacement. string
The name or description of the IPSet.
Arn string
The ARN of the WAF IPSet.
IpSetDescriptors []IpSetIpSetDescriptorArgs
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
Name Changes to this property will trigger replacement. string
The name or description of the IPSet.
arn String
The ARN of the WAF IPSet.
ipSetDescriptors List<IpSetIpSetDescriptor>
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
name Changes to this property will trigger replacement. String
The name or description of the IPSet.
arn string
The ARN of the WAF IPSet.
ipSetDescriptors IpSetIpSetDescriptor[]
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
name Changes to this property will trigger replacement. string
The name or description of the IPSet.
arn str
The ARN of the WAF IPSet.
ip_set_descriptors Sequence[IpSetIpSetDescriptorArgs]
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
name Changes to this property will trigger replacement. str
The name or description of the IPSet.
arn String
The ARN of the WAF IPSet.
ipSetDescriptors List<Property Map>
One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) from which web requests originate.
name Changes to this property will trigger replacement. String
The name or description of the IPSet.

Supporting Types

IpSetIpSetDescriptor
, IpSetIpSetDescriptorArgs

Type This property is required. string
The string like IPV4 or IPV6.
Value This property is required. string
The CIDR notation.
Type This property is required. string
The string like IPV4 or IPV6.
Value This property is required. string
The CIDR notation.
type This property is required. String
The string like IPV4 or IPV6.
value This property is required. String
The CIDR notation.
type This property is required. string
The string like IPV4 or IPV6.
value This property is required. string
The CIDR notation.
type This property is required. str
The string like IPV4 or IPV6.
value This property is required. str
The CIDR notation.
type This property is required. String
The string like IPV4 or IPV6.
value This property is required. String
The CIDR notation.

Import

Using pulumi import, import WAF Regional IPSets using their ID. For example:

$ pulumi import aws:wafregional/ipSet:IpSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.