regex_pattern_sets
Creates, updates, deletes or gets a regex_pattern_set resource or lists regex_pattern_sets in a region
Overview
| Name | regex_pattern_sets |
| Type | Resource |
| Description | Contains a list of Regular expressions based on the provided inputs. RegexPatternSet can be used with other WAF entities with RegexPatternSetReferenceStatement to perform other actions . |
| Id | awscc.wafv2.regex_pattern_sets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | ARN of the WAF entity. |
description | string | Description of the entity. |
name | string | Name of the RegexPatternSet. |
id | string | Id of the RegexPatternSet |
regular_expression_list | array | |
scope | string | Use CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application Load Balancer and API Gateway. |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the RegexPatternSet. |
id | string | Id of the RegexPatternSet |
scope | string | Use CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application Load Balancer and API Gateway. |
region | string | AWS region. |
For more information, see AWS::WAFv2::RegexPatternSet.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | regex_pattern_sets | INSERT | Scope, RegularExpressionList, region |
delete_resource | regex_pattern_sets | DELETE | Identifier, region |
update_resource | regex_pattern_sets | UPDATE | Identifier, PatchDocument, region |
list_resources | regex_pattern_sets_list_only | SELECT | region |
get_resource | regex_pattern_sets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all regex_pattern_sets in a region.
SELECT
region,
name,
id,
scope
FROM awscc.wafv2.regex_pattern_sets_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new regex_pattern_set resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ create */
INSERT INTO awscc.wafv2.regex_pattern_sets (
Description,
Name,
RegularExpressionList,
Scope,
Tags,
region
)
SELECT
'{{ description }}',
'{{ name }}',
'{{ regular_expression_list }}',
'{{ scope }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: regex_pattern_set
props:
- name: description
value: '{{ description }}'
- name: name
value: '{{ name }}'
- name: regular_expression_list
value:
- '{{ regular_expression_list[0] }}'
- name: scope
value: '{{ scope }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Delete
- Read
- Update
- List
wafv2:CreateRegexPatternSet,
wafv2:GetRegexPatternSet,
wafv2:TagResource,
wafv2:UntagResource,
wafv2:ListTagsForResource
wafv2:DeleteRegexPatternSet,
wafv2:GetRegexPatternSet
wafv2:GetRegexPatternSet,
wafv2:ListTagsForResource
wafv2:UpdateRegexPatternSet,
wafv2:GetRegexPatternSet,
wafv2:ListTagsForResource,
wafv2:TagResource,
wafv2:UntagResource
wafv2:listRegexPatternSets