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

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

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 WAF Geo Match Set Resource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const geoMatchSet = new aws.waf.GeoMatchSet("geo_match_set", {
        name: "geo_match_set",
        geoMatchConstraints: [
            {
                type: "Country",
                value: "US",
            },
            {
                type: "Country",
                value: "CA",
            },
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    geo_match_set = aws.waf.GeoMatchSet("geo_match_set",
        name="geo_match_set",
        geo_match_constraints=[
            {
                "type": "Country",
                "value": "US",
            },
            {
                "type": "Country",
                "value": "CA",
            },
        ])
    
    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.NewGeoMatchSet(ctx, "geo_match_set", &waf.GeoMatchSetArgs{
    			Name: pulumi.String("geo_match_set"),
    			GeoMatchConstraints: waf.GeoMatchSetGeoMatchConstraintArray{
    				&waf.GeoMatchSetGeoMatchConstraintArgs{
    					Type:  pulumi.String("Country"),
    					Value: pulumi.String("US"),
    				},
    				&waf.GeoMatchSetGeoMatchConstraintArgs{
    					Type:  pulumi.String("Country"),
    					Value: pulumi.String("CA"),
    				},
    			},
    		})
    		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 geoMatchSet = new Aws.Waf.GeoMatchSet("geo_match_set", new()
        {
            Name = "geo_match_set",
            GeoMatchConstraints = new[]
            {
                new Aws.Waf.Inputs.GeoMatchSetGeoMatchConstraintArgs
                {
                    Type = "Country",
                    Value = "US",
                },
                new Aws.Waf.Inputs.GeoMatchSetGeoMatchConstraintArgs
                {
                    Type = "Country",
                    Value = "CA",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.waf.GeoMatchSet;
    import com.pulumi.aws.waf.GeoMatchSetArgs;
    import com.pulumi.aws.waf.inputs.GeoMatchSetGeoMatchConstraintArgs;
    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 geoMatchSet = new GeoMatchSet("geoMatchSet", GeoMatchSetArgs.builder()
                .name("geo_match_set")
                .geoMatchConstraints(            
                    GeoMatchSetGeoMatchConstraintArgs.builder()
                        .type("Country")
                        .value("US")
                        .build(),
                    GeoMatchSetGeoMatchConstraintArgs.builder()
                        .type("Country")
                        .value("CA")
                        .build())
                .build());
    
        }
    }
    
    resources:
      geoMatchSet:
        type: aws:waf:GeoMatchSet
        name: geo_match_set
        properties:
          name: geo_match_set
          geoMatchConstraints:
            - type: Country
              value: US
            - type: Country
              value: CA
    

    Create GeoMatchSet Resource

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

    Constructor syntax

    new GeoMatchSet(name: string, args?: GeoMatchSetArgs, opts?: CustomResourceOptions);
    @overload
    def GeoMatchSet(resource_name: str,
                    args: Optional[GeoMatchSetArgs] = None,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def GeoMatchSet(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    geo_match_constraints: Optional[Sequence[GeoMatchSetGeoMatchConstraintArgs]] = None,
                    name: Optional[str] = None)
    func NewGeoMatchSet(ctx *Context, name string, args *GeoMatchSetArgs, opts ...ResourceOption) (*GeoMatchSet, error)
    public GeoMatchSet(string name, GeoMatchSetArgs? args = null, CustomResourceOptions? opts = null)
    public GeoMatchSet(String name, GeoMatchSetArgs args)
    public GeoMatchSet(String name, GeoMatchSetArgs args, CustomResourceOptions options)
    
    type: aws:waf:GeoMatchSet
    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 GeoMatchSetArgs
    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 GeoMatchSetArgs
    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 GeoMatchSetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GeoMatchSetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GeoMatchSetArgs
    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 geoMatchSetResource = new Aws.Waf.GeoMatchSet("geoMatchSetResource", new()
    {
        GeoMatchConstraints = new[]
        {
            new Aws.Waf.Inputs.GeoMatchSetGeoMatchConstraintArgs
            {
                Type = "string",
                Value = "string",
            },
        },
        Name = "string",
    });
    
    example, err := waf.NewGeoMatchSet(ctx, "geoMatchSetResource", &waf.GeoMatchSetArgs{
    	GeoMatchConstraints: waf.GeoMatchSetGeoMatchConstraintArray{
    		&waf.GeoMatchSetGeoMatchConstraintArgs{
    			Type:  pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var geoMatchSetResource = new GeoMatchSet("geoMatchSetResource", GeoMatchSetArgs.builder()
        .geoMatchConstraints(GeoMatchSetGeoMatchConstraintArgs.builder()
            .type("string")
            .value("string")
            .build())
        .name("string")
        .build());
    
    geo_match_set_resource = aws.waf.GeoMatchSet("geoMatchSetResource",
        geo_match_constraints=[{
            "type": "string",
            "value": "string",
        }],
        name="string")
    
    const geoMatchSetResource = new aws.waf.GeoMatchSet("geoMatchSetResource", {
        geoMatchConstraints: [{
            type: "string",
            value: "string",
        }],
        name: "string",
    });
    
    type: aws:waf:GeoMatchSet
    properties:
        geoMatchConstraints:
            - type: string
              value: string
        name: string
    

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

    GeoMatchConstraints List<GeoMatchSetGeoMatchConstraint>
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    Name string
    The name or description of the GeoMatchSet.
    GeoMatchConstraints []GeoMatchSetGeoMatchConstraintArgs
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    Name string
    The name or description of the GeoMatchSet.
    geoMatchConstraints List<GeoMatchSetGeoMatchConstraint>
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    name String
    The name or description of the GeoMatchSet.
    geoMatchConstraints GeoMatchSetGeoMatchConstraint[]
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    name string
    The name or description of the GeoMatchSet.
    geo_match_constraints Sequence[GeoMatchSetGeoMatchConstraintArgs]
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    name str
    The name or description of the GeoMatchSet.
    geoMatchConstraints List<Property Map>
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    name String
    The name or description of the GeoMatchSet.

    Outputs

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

    Arn string
    Amazon Resource Name (ARN)
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    Amazon Resource Name (ARN)
    Id string
    The provider-assigned unique ID for this managed resource.
    arn String
    Amazon Resource Name (ARN)
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    Amazon Resource Name (ARN)
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    Amazon Resource Name (ARN)
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    Amazon Resource Name (ARN)
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GeoMatchSet Resource

    Get an existing GeoMatchSet 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?: GeoMatchSetState, opts?: CustomResourceOptions): GeoMatchSet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            geo_match_constraints: Optional[Sequence[GeoMatchSetGeoMatchConstraintArgs]] = None,
            name: Optional[str] = None) -> GeoMatchSet
    func GetGeoMatchSet(ctx *Context, name string, id IDInput, state *GeoMatchSetState, opts ...ResourceOption) (*GeoMatchSet, error)
    public static GeoMatchSet Get(string name, Input<string> id, GeoMatchSetState? state, CustomResourceOptions? opts = null)
    public static GeoMatchSet get(String name, Output<String> id, GeoMatchSetState 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
    Amazon Resource Name (ARN)
    GeoMatchConstraints List<GeoMatchSetGeoMatchConstraint>
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    Name string
    The name or description of the GeoMatchSet.
    Arn string
    Amazon Resource Name (ARN)
    GeoMatchConstraints []GeoMatchSetGeoMatchConstraintArgs
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    Name string
    The name or description of the GeoMatchSet.
    arn String
    Amazon Resource Name (ARN)
    geoMatchConstraints List<GeoMatchSetGeoMatchConstraint>
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    name String
    The name or description of the GeoMatchSet.
    arn string
    Amazon Resource Name (ARN)
    geoMatchConstraints GeoMatchSetGeoMatchConstraint[]
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    name string
    The name or description of the GeoMatchSet.
    arn str
    Amazon Resource Name (ARN)
    geo_match_constraints Sequence[GeoMatchSetGeoMatchConstraintArgs]
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    name str
    The name or description of the GeoMatchSet.
    arn String
    Amazon Resource Name (ARN)
    geoMatchConstraints List<Property Map>
    The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
    name String
    The name or description of the GeoMatchSet.

    Supporting Types

    GeoMatchSetGeoMatchConstraint, GeoMatchSetGeoMatchConstraintArgs

    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 Geo Match Set using their ID. For example:

    $ pulumi import aws:waf/geoMatchSet:GeoMatchSet 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.42.0 published on Wednesday, Jun 26, 2024 by Pulumi