aws.wafv2.RegexPatternSet
Provides an AWS WAFv2 Regex Pattern Set Resource
Example Usage
using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.WafV2.RegexPatternSet("example", new()
{
Description = "Example regex pattern set",
RegularExpressions = new[]
{
new Aws.WafV2.Inputs.RegexPatternSetRegularExpressionArgs
{
RegexString = "one",
},
new Aws.WafV2.Inputs.RegexPatternSetRegularExpressionArgs
{
RegexString = "two",
},
},
Scope = "REGIONAL",
Tags =
{
{ "Tag1", "Value1" },
{ "Tag2", "Value2" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/wafv2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := wafv2.NewRegexPatternSet(ctx, "example", &wafv2.RegexPatternSetArgs{
Description: pulumi.String("Example regex pattern set"),
RegularExpressions: wafv2.RegexPatternSetRegularExpressionArray{
&wafv2.RegexPatternSetRegularExpressionArgs{
RegexString: pulumi.String("one"),
},
&wafv2.RegexPatternSetRegularExpressionArgs{
RegexString: pulumi.String("two"),
},
},
Scope: pulumi.String("REGIONAL"),
Tags: pulumi.StringMap{
"Tag1": pulumi.String("Value1"),
"Tag2": pulumi.String("Value2"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.wafv2.RegexPatternSet;
import com.pulumi.aws.wafv2.RegexPatternSetArgs;
import com.pulumi.aws.wafv2.inputs.RegexPatternSetRegularExpressionArgs;
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 RegexPatternSet("example", RegexPatternSetArgs.builder()
.description("Example regex pattern set")
.regularExpressions(
RegexPatternSetRegularExpressionArgs.builder()
.regexString("one")
.build(),
RegexPatternSetRegularExpressionArgs.builder()
.regexString("two")
.build())
.scope("REGIONAL")
.tags(Map.ofEntries(
Map.entry("Tag1", "Value1"),
Map.entry("Tag2", "Value2")
))
.build());
}
}
import pulumi
import pulumi_aws as aws
example = aws.wafv2.RegexPatternSet("example",
description="Example regex pattern set",
regular_expressions=[
aws.wafv2.RegexPatternSetRegularExpressionArgs(
regex_string="one",
),
aws.wafv2.RegexPatternSetRegularExpressionArgs(
regex_string="two",
),
],
scope="REGIONAL",
tags={
"Tag1": "Value1",
"Tag2": "Value2",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.wafv2.RegexPatternSet("example", {
description: "Example regex pattern set",
regularExpressions: [
{
regexString: "one",
},
{
regexString: "two",
},
],
scope: "REGIONAL",
tags: {
Tag1: "Value1",
Tag2: "Value2",
},
});
resources:
example:
type: aws:wafv2:RegexPatternSet
properties:
description: Example regex pattern set
regularExpressions:
- regexString: one
- regexString: two
scope: REGIONAL
tags:
Tag1: Value1
Tag2: Value2
Create RegexPatternSet Resource
new RegexPatternSet(name: string, args: RegexPatternSetArgs, opts?: CustomResourceOptions);
@overload
def RegexPatternSet(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
name: Optional[str] = None,
regular_expressions: Optional[Sequence[RegexPatternSetRegularExpressionArgs]] = None,
scope: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
@overload
def RegexPatternSet(resource_name: str,
args: RegexPatternSetArgs,
opts: Optional[ResourceOptions] = None)
func NewRegexPatternSet(ctx *Context, name string, args RegexPatternSetArgs, opts ...ResourceOption) (*RegexPatternSet, error)
public RegexPatternSet(string name, RegexPatternSetArgs args, CustomResourceOptions? opts = null)
public RegexPatternSet(String name, RegexPatternSetArgs args)
public RegexPatternSet(String name, RegexPatternSetArgs args, CustomResourceOptions options)
type: aws:wafv2:RegexPatternSet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegexPatternSetArgs
- 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 RegexPatternSetArgs
- 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 RegexPatternSetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegexPatternSetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RegexPatternSetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RegexPatternSet 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 RegexPatternSet resource accepts the following input properties:
- 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 regionus-east-1
(N. Virginia) on the AWS provider.- Description string
A friendly description of the regular expression pattern set.
- Name string
A friendly name of the regular expression pattern set.
- Regular
Expressions List<Pulumi.Aws. Waf V2. Inputs. Regex Pattern Set Regular Expression Args> One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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.
- 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 regionus-east-1
(N. Virginia) on the AWS provider.- Description string
A friendly description of the regular expression pattern set.
- Name string
A friendly name of the regular expression pattern set.
- Regular
Expressions []RegexPattern Set Regular Expression Args One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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.
- 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 regionus-east-1
(N. Virginia) on the AWS provider.- description String
A friendly description of the regular expression pattern set.
- name String
A friendly name of the regular expression pattern set.
- regular
Expressions List<RegexPattern Set Regular Expression Args> One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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.
- 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 regionus-east-1
(N. Virginia) on the AWS provider.- description string
A friendly description of the regular expression pattern set.
- name string
A friendly name of the regular expression pattern set.
- regular
Expressions RegexPattern Set Regular Expression Args[] One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- {[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.
- 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 regionus-east-1
(N. Virginia) on the AWS provider.- description str
A friendly description of the regular expression pattern set.
- name str
A friendly name of the regular expression pattern set.
- regular_
expressions Sequence[RegexPattern Set Regular Expression Args] One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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.
- 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 regionus-east-1
(N. Virginia) on the AWS provider.- description String
A friendly description of the regular expression pattern set.
- name String
A friendly name of the regular expression pattern set.
- regular
Expressions List<Property Map> One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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 RegexPatternSet resource produces the following output properties:
- arn str
The Amazon Resource Name (ARN) that identifies the cluster.
- 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 RegexPatternSet Resource
Get an existing RegexPatternSet 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?: RegexPatternSetState, opts?: CustomResourceOptions): RegexPatternSet
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
description: Optional[str] = None,
lock_token: Optional[str] = None,
name: Optional[str] = None,
regular_expressions: Optional[Sequence[RegexPatternSetRegularExpressionArgs]] = None,
scope: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> RegexPatternSet
func GetRegexPatternSet(ctx *Context, name string, id IDInput, state *RegexPatternSetState, opts ...ResourceOption) (*RegexPatternSet, error)
public static RegexPatternSet Get(string name, Input<string> id, RegexPatternSetState? state, CustomResourceOptions? opts = null)
public static RegexPatternSet get(String name, Output<String> id, RegexPatternSetState 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.
- Arn string
The Amazon Resource Name (ARN) that identifies the cluster.
- Description string
A friendly description of the regular expression pattern set.
- Lock
Token string - Name string
A friendly name of the regular expression pattern set.
- Regular
Expressions List<Pulumi.Aws. Waf V2. Inputs. Regex Pattern Set Regular Expression Args> One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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 regionus-east-1
(N. Virginia) on the AWS provider.- 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.
- Arn string
The Amazon Resource Name (ARN) that identifies the cluster.
- Description string
A friendly description of the regular expression pattern set.
- Lock
Token string - Name string
A friendly name of the regular expression pattern set.
- Regular
Expressions []RegexPattern Set Regular Expression Args One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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 regionus-east-1
(N. Virginia) on the AWS provider.- 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.
- arn String
The Amazon Resource Name (ARN) that identifies the cluster.
- description String
A friendly description of the regular expression pattern set.
- lock
Token String - name String
A friendly name of the regular expression pattern set.
- regular
Expressions List<RegexPattern Set Regular Expression Args> One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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 regionus-east-1
(N. Virginia) on the AWS provider.- 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.
- arn string
The Amazon Resource Name (ARN) that identifies the cluster.
- description string
A friendly description of the regular expression pattern set.
- lock
Token string - name string
A friendly name of the regular expression pattern set.
- regular
Expressions RegexPattern Set Regular Expression Args[] One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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 regionus-east-1
(N. Virginia) on the AWS provider.- {[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.
- arn str
The Amazon Resource Name (ARN) that identifies the cluster.
- description str
A friendly description of the regular expression pattern set.
- lock_
token str - name str
A friendly name of the regular expression pattern set.
- regular_
expressions Sequence[RegexPattern Set Regular Expression Args] One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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 regionus-east-1
(N. Virginia) on the AWS provider.- 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.
- arn String
The Amazon Resource Name (ARN) that identifies the cluster.
- description String
A friendly description of the regular expression pattern set.
- lock
Token String - name String
A friendly name of the regular expression pattern set.
- regular
Expressions List<Property Map> One or more blocks of regular expression patterns that you want AWS WAF to search for, such as
B[a@]dB[o0]t
. See Regular Expression below for details.- 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 regionus-east-1
(N. Virginia) on the AWS provider.- 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.
Supporting Types
RegexPatternSetRegularExpression
- Regex
String string The string representing the regular expression, see the AWS WAF documentation for more information.
- Regex
String string The string representing the regular expression, see the AWS WAF documentation for more information.
- regex
String String The string representing the regular expression, see the AWS WAF documentation for more information.
- regex
String string The string representing the regular expression, see the AWS WAF documentation for more information.
- regex_
string str The string representing the regular expression, see the AWS WAF documentation for more information.
- regex
String String The string representing the regular expression, see the AWS WAF documentation for more information.
Import
WAFv2 Regex Pattern Sets can be imported using ID/name/scope
e.g.,
$ pulumi import aws:wafv2/regexPatternSet:RegexPatternSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.