AWS WAF Byte Match Set
This page shows how to write Terraform and CloudFormation for AWS WAF Byte Match Set and write them securely.
aws_waf_byte_match_set (Terraform)
The Byte Match Set in AWS WAF can be configured in Terraform with the resource name aws_waf_byte_match_set
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_waf_byte_match_set" "this" {
for_each = { for rule in var.waf_rules : rule.name => rule if length(rule.byte_match_tuples) > 0 }
name = each.key
dynamic byte_match_tuples {
for_each = concat([], each.value.byte_match_tuples)
Parameters
-
id
optional computed - string -
name
required - string -
byte_match_tuples
set block-
positional_constraint
required - string -
target_string
optional - string -
text_transformation
required - string -
field_to_match
list block
-
Explanation in Terraform Registry
Provides a WAF Byte Match Set Resource
AWS::WAF::ByteMatchSet (CloudFormation)
The ByteMatchSet in WAF can be configured in CloudFormation with the resource name AWS::WAF::ByteMatchSet
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: 'AWS::WAF::ByteMatchSet'
Properties:
Name: 'allowget'
ByteMatchTuples:
- FieldToMatch:
Type: 'METHOD'
Type: AWS::WAF::ByteMatchSet
Condition: isGlobal
Properties:
Name: !Join ['-', [!Ref stackPrefix, 'match-auth-tokens']]
ByteMatchTuples:
- FieldToMatch:
Type: AWS::WAF::ByteMatchSet
Condition: isGlobal
Properties:
Name: !Join ['-', [!Ref stackPrefix, 'match-auth-tokens']]
ByteMatchTuples:
- FieldToMatch:
Type: AWS::WAF::ByteMatchSet
Condition: isGlobal
Properties:
Name: !Join ['-', [!Ref stackPrefix, 'match-auth-tokens']]
ByteMatchTuples:
- FieldToMatch:
Type: AWS::WAF::ByteMatchSet
Condition: isGlobal
Properties:
Name: URIOGNLStartStringFilter
ByteMatchTuples:
- FieldToMatch:
"Type": "AWS::WAF::ByteMatchSet",
"Condition": "isGlobal",
"Properties": {
"Name": {
"Fn::Join": [
"-",
"Type": "AWS::WAF::ByteMatchSet",
"Properties": {
"Name": "PRServlet Match",
"ByteMatchTuples": [
{
"FieldToMatch": {
"resourceType" : "AWS::WAF::ByteMatchSet",
"properties" : [ {
"propertyName" : "ByteMatchTuples",
"propertyType" : "List<AWS::WAF::ByteMatchSet::ByteMatchTuple>",
"required" : false,
"propertyHref" : "aws-properties-waf-bytematchset-bytematchtuples.html"
"Type": "AWS::WAF::ByteMatchSet",
"Properties": {
"Name": {
"Ref": "ByteURICondition2"
},
"ByteMatchTuples": [
"Type": "AWS::WAF::ByteMatchSet",
"Properties": {
"Name": {
"Ref": "ByteHeaderCondition2"
},
"ByteMatchTuples": [
Parameters
-
ByteMatchTuples
optional - List of ByteMatchTuple -
Name
required - String
Explanation in CloudFormation Registry
Note This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide. For the latest version of AWS WAF , use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use. The
AWS::WAF::ByteMatchSet
resource creates an AWS WAFByteMatchSet
that identifies a part of a web request that you want to inspect.
Frequently asked questions
What is AWS WAF Byte Match Set?
AWS WAF Byte Match Set is a resource for WAF of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS WAF Byte Match Set?
For Terraform, the Flaconi/terraform-aws-waf-acl-rules source code example is useful. See the Terraform Example section for further details.
For CloudFormation, the CU-CommunityApps/waf-testing, Amish132/Cloud-AWS--Fault-Tolerant-Notes-Application and gaurangdavda/CloudNote source code examples are useful. See the CloudFormation Example section for further details.