1. Packages
  2. AWS Classic
  3. API Docs
  4. wafv2
  5. IpSet

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.wafv2.IpSet

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a WAFv2 IP Set Resource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.wafv2.IpSet("example", {
        name: "example",
        description: "Example IP set",
        scope: "REGIONAL",
        ipAddressVersion: "IPV4",
        addresses: [
            "1.2.3.4/32",
            "5.6.7.8/32",
        ],
        tags: {
            Tag1: "Value1",
            Tag2: "Value2",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.wafv2.IpSet("example",
        name="example",
        description="Example IP set",
        scope="REGIONAL",
        ip_address_version="IPV4",
        addresses=[
            "1.2.3.4/32",
            "5.6.7.8/32",
        ],
        tags={
            "Tag1": "Value1",
            "Tag2": "Value2",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/wafv2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := wafv2.NewIpSet(ctx, "example", &wafv2.IpSetArgs{
    			Name:             pulumi.String("example"),
    			Description:      pulumi.String("Example IP set"),
    			Scope:            pulumi.String("REGIONAL"),
    			IpAddressVersion: pulumi.String("IPV4"),
    			Addresses: pulumi.StringArray{
    				pulumi.String("1.2.3.4/32"),
    				pulumi.String("5.6.7.8/32"),
    			},
    			Tags: pulumi.StringMap{
    				"Tag1": pulumi.String("Value1"),
    				"Tag2": pulumi.String("Value2"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.WafV2.IpSet("example", new()
        {
            Name = "example",
            Description = "Example IP set",
            Scope = "REGIONAL",
            IpAddressVersion = "IPV4",
            Addresses = new[]
            {
                "1.2.3.4/32",
                "5.6.7.8/32",
            },
            Tags = 
            {
                { "Tag1", "Value1" },
                { "Tag2", "Value2" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.wafv2.IpSet;
    import com.pulumi.aws.wafv2.IpSetArgs;
    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 example = new IpSet("example", IpSetArgs.builder()
                .name("example")
                .description("Example IP set")
                .scope("REGIONAL")
                .ipAddressVersion("IPV4")
                .addresses(            
                    "1.2.3.4/32",
                    "5.6.7.8/32")
                .tags(Map.ofEntries(
                    Map.entry("Tag1", "Value1"),
                    Map.entry("Tag2", "Value2")
                ))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:wafv2:IpSet
        properties:
          name: example
          description: Example IP set
          scope: REGIONAL
          ipAddressVersion: IPV4
          addresses:
            - 1.2.3.4/32
            - 5.6.7.8/32
          tags:
            Tag1: Value1
            Tag2: Value2
    

    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: IpSetArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def IpSet(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              ip_address_version: Optional[str] = None,
              scope: Optional[str] = None,
              addresses: Optional[Sequence[str]] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              tags: Optional[Mapping[str, str]] = None)
    func NewIpSet(ctx *Context, name string, args IpSetArgs, opts ...ResourceOption) (*IpSet, error)
    public IpSet(string name, IpSetArgs args, CustomResourceOptions? opts = null)
    public IpSet(String name, IpSetArgs args)
    public IpSet(String name, IpSetArgs args, CustomResourceOptions options)
    
    type: aws:wafv2:IpSet
    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 IpSetArgs
    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 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 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 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 String
    The unique name of the resource.
    args 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 exampleipSetResourceResourceFromWafv2ipSet = new Aws.WafV2.IpSet("exampleipSetResourceResourceFromWafv2ipSet", new()
    {
        IpAddressVersion = "string",
        Scope = "string",
        Addresses = new[]
        {
            "string",
        },
        Description = "string",
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := wafv2.NewIpSet(ctx, "exampleipSetResourceResourceFromWafv2ipSet", &wafv2.IpSetArgs{
    	IpAddressVersion: pulumi.String("string"),
    	Scope:            pulumi.String("string"),
    	Addresses: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var exampleipSetResourceResourceFromWafv2ipSet = new IpSet("exampleipSetResourceResourceFromWafv2ipSet", IpSetArgs.builder()
        .ipAddressVersion("string")
        .scope("string")
        .addresses("string")
        .description("string")
        .name("string")
        .tags(Map.of("string", "string"))
        .build());
    
    exampleip_set_resource_resource_from_wafv2ip_set = aws.wafv2.IpSet("exampleipSetResourceResourceFromWafv2ipSet",
        ip_address_version="string",
        scope="string",
        addresses=["string"],
        description="string",
        name="string",
        tags={
            "string": "string",
        })
    
    const exampleipSetResourceResourceFromWafv2ipSet = new aws.wafv2.IpSet("exampleipSetResourceResourceFromWafv2ipSet", {
        ipAddressVersion: "string",
        scope: "string",
        addresses: ["string"],
        description: "string",
        name: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:wafv2:IpSet
    properties:
        addresses:
            - string
        description: string
        ipAddressVersion: string
        name: string
        scope: string
        tags:
            string: string
    

    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

    The IpSet resource accepts the following input properties:

    IpAddressVersion string
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    Scope string
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    Addresses List<string>
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    Description string
    A friendly description of the IP set.
    Name string
    A friendly name of the IP set.
    Tags Dictionary<string, string>
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    IpAddressVersion string
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    Scope string
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    Addresses []string
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    Description string
    A friendly description of the IP set.
    Name string
    A friendly name of the IP set.
    Tags map[string]string
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    ipAddressVersion String
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    scope String
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    addresses List<String>
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    description String
    A friendly description of the IP set.
    name String
    A friendly name of the IP set.
    tags Map<String,String>
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    ipAddressVersion string
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    scope string
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    addresses string[]
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    description string
    A friendly description of the IP set.
    name string
    A friendly name of the IP set.
    tags {[key: string]: string}
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    ip_address_version str
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    scope str
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    addresses Sequence[str]
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    description str
    A friendly description of the IP set.
    name str
    A friendly name of the IP set.
    tags Mapping[str, str]
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    ipAddressVersion String
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    scope String
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    addresses List<String>
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    description String
    A friendly description of the IP set.
    name String
    A friendly name of the IP set.
    tags Map<String>
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

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

    Arn string
    The Amazon Resource Name (ARN) of the IP set.
    Id string
    The provider-assigned unique ID for this managed resource.
    LockToken string
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Arn string
    The Amazon Resource Name (ARN) of the IP set.
    Id string
    The provider-assigned unique ID for this managed resource.
    LockToken string
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The Amazon Resource Name (ARN) of the IP set.
    id String
    The provider-assigned unique ID for this managed resource.
    lockToken String
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn string
    The Amazon Resource Name (ARN) of the IP set.
    id string
    The provider-assigned unique ID for this managed resource.
    lockToken string
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn str
    The Amazon Resource Name (ARN) of the IP set.
    id str
    The provider-assigned unique ID for this managed resource.
    lock_token str
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The Amazon Resource Name (ARN) of the IP set.
    id String
    The provider-assigned unique ID for this managed resource.
    lockToken String
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    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,
            addresses: Optional[Sequence[str]] = None,
            arn: Optional[str] = None,
            description: Optional[str] = None,
            ip_address_version: Optional[str] = None,
            lock_token: Optional[str] = None,
            name: Optional[str] = None,
            scope: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, 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)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    Addresses List<string>
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    Arn string
    The Amazon Resource Name (ARN) of the IP set.
    Description string
    A friendly description of the IP set.
    IpAddressVersion string
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    LockToken string
    Name string
    A friendly name of the IP set.
    Scope string
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    Tags Dictionary<string, string>
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Addresses []string
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    Arn string
    The Amazon Resource Name (ARN) of the IP set.
    Description string
    A friendly description of the IP set.
    IpAddressVersion string
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    LockToken string
    Name string
    A friendly name of the IP set.
    Scope string
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    Tags map[string]string
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    addresses List<String>
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    arn String
    The Amazon Resource Name (ARN) of the IP set.
    description String
    A friendly description of the IP set.
    ipAddressVersion String
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    lockToken String
    name String
    A friendly name of the IP set.
    scope String
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    tags Map<String,String>
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    addresses string[]
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    arn string
    The Amazon Resource Name (ARN) of the IP set.
    description string
    A friendly description of the IP set.
    ipAddressVersion string
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    lockToken string
    name string
    A friendly name of the IP set.
    scope string
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    tags {[key: string]: string}
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    addresses Sequence[str]
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    arn str
    The Amazon Resource Name (ARN) of the IP set.
    description str
    A friendly description of the IP set.
    ip_address_version str
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    lock_token str
    name str
    A friendly name of the IP set.
    scope str
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    tags Mapping[str, str]
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    addresses List<String>
    Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
    arn String
    The Amazon Resource Name (ARN) of the IP set.
    description String
    A friendly description of the IP set.
    ipAddressVersion String
    Specify IPV4 or IPV6. Valid values are IPV4 or IPV6.
    lockToken String
    name String
    A friendly name of the IP set.
    scope String
    Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. To work with CloudFront, you must also specify the Region US East (N. Virginia).
    tags Map<String>
    An array of key:value pairs to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Import

    Using pulumi import, import WAFv2 IP Sets using ID/name/scope. For example:

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

    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.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi