Skip to main content

regex_pattern_sets

Creates, updates, deletes or gets a regex_pattern_set resource or lists regex_pattern_sets in a region

Overview

Nameregex_pattern_sets
TypeResource
DescriptionContains a list of Regular expressions based on the provided inputs. RegexPatternSet can be used with other WAF entities with RegexPatternSetReferenceStatement to perform other actions .
Idawscc.wafv2.regex_pattern_sets

Fields

NameDatatypeDescription
arnstringARN of the WAF entity.
descriptionstringDescription of the entity.
namestringName of the RegexPatternSet.
idstringId of the RegexPatternSet
regular_expression_listarray
scopestringUse CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application Load Balancer and API Gateway.
tagsarray
regionstringAWS region.

For more information, see AWS::WAFv2::RegexPatternSet.

Methods

NameResourceAccessible byRequired Params
create_resourceregex_pattern_setsINSERTScope, RegularExpressionList, region
delete_resourceregex_pattern_setsDELETEIdentifier, region
update_resourceregex_pattern_setsUPDATEIdentifier, PatchDocument, region
list_resourcesregex_pattern_sets_list_onlySELECTregion
get_resourceregex_pattern_setsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual regex_pattern_set.

SELECT
region,
arn,
description,
name,
id,
regular_expression_list,
scope,
tags
FROM awscc.wafv2.regex_pattern_sets
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}|{{ id }}|{{ scope }}';

INSERT example

Use the following StackQL query and manifest file to create a new regex_pattern_set resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.wafv2.regex_pattern_sets (
RegularExpressionList,
Scope,
region
)
SELECT
'{{ regular_expression_list }}',
'{{ scope }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a regex_pattern_set resource, using stack-deploy.

/*+ update */
UPDATE awscc.wafv2.regex_pattern_sets
SET PatchDocument = string('{{ {
"Description": description,
"RegularExpressionList": regular_expression_list,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}|{{ id }}|{{ scope }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.wafv2.regex_pattern_sets
WHERE
Identifier = '{{ name }}|{{ id }}|{{ scope }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the regex_pattern_sets resource, the following permissions are required:

wafv2:CreateRegexPatternSet,
wafv2:GetRegexPatternSet,
wafv2:TagResource,
wafv2:UntagResource,
wafv2:ListTagsForResource