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

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

AWS Classic v6.40.0 published on Wednesday, Jun 12, 2024 by Pulumi

aws.waf.IpSet

Explore with Pulumi AI

aws logo

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

AWS Classic v6.40.0 published on Wednesday, Jun 12, 2024 by Pulumi

    Provides a WAF IPSet Resource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const ipset = new aws.waf.IpSet("ipset", {
        name: "tfIPSet",
        ipSetDescriptors: [
            {
                type: "IPV4",
                value: "192.0.7.0/24",
            },
            {
                type: "IPV4",
                value: "10.16.16.0/16",
            },
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    ipset = aws.waf.IpSet("ipset",
        name="tfIPSet",
        ip_set_descriptors=[
            aws.waf.IpSetIpSetDescriptorArgs(
                type="IPV4",
                value="192.0.7.0/24",
            ),
            aws.waf.IpSetIpSetDescriptorArgs(
                type="IPV4",
                value="10.16.16.0/16",
            ),
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/waf"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := waf.NewIpSet(ctx, "ipset", &waf.IpSetArgs{
    			Name: pulumi.String("tfIPSet"),
    			IpSetDescriptors: waf.IpSetIpSetDescriptorArray{
    				&waf.IpSetIpSetDescriptorArgs{
    					Type:  pulumi.String("IPV4"),
    					Value: pulumi.String("192.0.7.0/24"),
    				},
    				&waf.IpSetIpSetDescriptorArgs{
    					Type:  pulumi.String("IPV4"),
    					Value: pulumi.String("10.16.16.0/16"),
    				},
    			},
    		})
    		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 ipset = new Aws.Waf.IpSet("ipset", new()
        {
            Name = "tfIPSet",
            IpSetDescriptors = new[]
            {
                new Aws.Waf.Inputs.IpSetIpSetDescriptorArgs
                {
                    Type = "IPV4",
                    Value = "192.0.7.0/24",
                },
                new Aws.Waf.Inputs.IpSetIpSetDescriptorArgs
                {
                    Type = "IPV4",
                    Value = "10.16.16.0/16",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.waf.IpSet;
    import com.pulumi.aws.waf.IpSetArgs;
    import com.pulumi.aws.waf.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());
    
        }
    }
    
    resources:
      ipset:
        type: aws:waf:IpSet
        properties:
          name: tfIPSet
          ipSetDescriptors:
            - type: IPV4
              value: 192.0.7.0/24
            - type: IPV4
              value: 10.16.16.0/16
    

    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:waf: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.

    Example

    The following reference example uses placeholder values for all input properties.

    var ipSetResource = new Aws.Waf.IpSet("ipSetResource", new()
    {
        IpSetDescriptors = new[]
        {
            new Aws.Waf.Inputs.IpSetIpSetDescriptorArgs
            {
                Type = "string",
                Value = "string",
            },
        },
        Name = "string",
    });
    
    example, err := waf.NewIpSet(ctx, "ipSetResource", &waf.IpSetArgs{
    	IpSetDescriptors: waf.IpSetIpSetDescriptorArray{
    		&waf.IpSetIpSetDescriptorArgs{
    			Type:  pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var ipSetResource = new IpSet("ipSetResource", IpSetArgs.builder()
        .ipSetDescriptors(IpSetIpSetDescriptorArgs.builder()
            .type("string")
            .value("string")
            .build())
        .name("string")
        .build());
    
    ip_set_resource = aws.waf.IpSet("ipSetResource",
        ip_set_descriptors=[aws.waf.IpSetIpSetDescriptorArgs(
            type="string",
            value="string",
        )],
        name="string")
    
    const ipSetResource = new aws.waf.IpSet("ipSetResource", {
        ipSetDescriptors: [{
            type: "string",
            value: "string",
        }],
        name: "string",
    });
    
    type: aws:waf:IpSet
    properties:
        ipSetDescriptors:
            - type: string
              value: string
        name: 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:

    IpSetDescriptors List<IpSetIpSetDescriptor>
    One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR format) from which web requests originate.
    Name 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 format) from which web requests originate.
    Name 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 format) from which web requests originate.
    name 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 format) from which web requests originate.
    name 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 format) from which web requests originate.
    name 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 format) from which web requests originate.
    name 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)
    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:
    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 format) from which web requests originate.
    Name 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 format) from which web requests originate.
    Name 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 format) from which web requests originate.
    name 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 format) from which web requests originate.
    name 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 format) from which web requests originate.
    name 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 format) from which web requests originate.
    name String
    The name or description of the IPSet.

    Supporting Types

    IpSetIpSetDescriptor, IpSetIpSetDescriptorArgs

    Type string
    Value string
    Type string
    Value string
    type String
    value String
    type string
    value string
    type str
    value str
    type String
    value String

    Import

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

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

    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.40.0 published on Wednesday, Jun 12, 2024 by Pulumi