Try AWS Native preview for resources not in the classic version.
aws.wafv2.IpSet
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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)
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:
- Ip
Address stringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - Scope string
- Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are
CLOUDFRONT
orREGIONAL
. 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.
- 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.
- Ip
Address stringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - Scope string
- Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are
CLOUDFRONT
orREGIONAL
. 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.
- 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.
- ip
Address StringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - scope String
- Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are
CLOUDFRONT
orREGIONAL
. 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.
- 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.
- ip
Address stringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - scope string
- Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are
CLOUDFRONT
orREGIONAL
. 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.
- {[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_ strversion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - scope str
- Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are
CLOUDFRONT
orREGIONAL
. 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.
- 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.
- ip
Address StringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - scope String
- Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are
CLOUDFRONT
orREGIONAL
. 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.
- 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 str
- The Amazon Resource Name (ARN) of the IP set.
- id str
- The provider-assigned unique ID for this managed resource.
- lock_
token str - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
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.
- 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.
- Ip
Address stringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - Lock
Token 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
orREGIONAL
. To work with CloudFront, you must also specify the Region US East (N. Virginia). - 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. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- Ip
Address stringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - Lock
Token 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
orREGIONAL
. To work with CloudFront, you must also specify the Region US East (N. Virginia). - 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. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- ip
Address StringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - lock
Token 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
orREGIONAL
. To work with CloudFront, you must also specify the Region US East (N. Virginia). - 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. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- ip
Address stringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - lock
Token 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
orREGIONAL
. To work with CloudFront, you must also specify the Region US East (N. Virginia). - {[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. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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_ strversion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - 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
orREGIONAL
. To work with CloudFront, you must also specify the Region US East (N. Virginia). - 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. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- ip
Address StringVersion - Specify IPV4 or IPV6. Valid values are
IPV4
orIPV6
. - lock
Token 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
orREGIONAL
. To work with CloudFront, you must also specify the Region US East (N. Virginia). - 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. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
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.
Try AWS Native preview for resources not in the classic version.