AWS WAF Regional Regional Rule Group
This page shows how to write Terraform and CloudFormation for AWS WAF Regional Regional Rule Group and write them securely.
aws_wafregional_rule_group (Terraform)
The Regional Rule Group in AWS WAF Regional can be configured in Terraform with the resource name aws_wafregional_rule_group
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_wafregional_rule_group" "this" {
metric_name = var.metric_name
name = var.name
tags = var.tags
dynamic "activated_rule" {
Parameters
-
arn
optional computed - string -
id
optional computed - string -
metric_name
required - string -
name
required - string -
tags
optional - map from string to string -
activated_rule
set block
Explanation in Terraform Registry
Provides a WAF Regional Rule Group Resource
AWS::WAFRegional::Rule (CloudFormation)
The Rule in WAFRegional can be configured in CloudFormation with the resource name AWS::WAFRegional::Rule
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::WAFRegional::Rule
Properties:
MetricName: 'mitigatesqli'
Name: !Sub '${AWS::StackName}-mitigate-sqli'
Predicates:
- Type: SqlInjectionMatch
Type: AWS::WAFRegional::Rule
Properties:
MetricName: 'mitigatesqli'
Name: !Sub '${AWS::StackName}-mitigate-sqli'
Predicates:
- Type: SqlInjectionMatch
Type: AWS::WAFRegional::Rule
Properties:
MetricName: 'mitigatesqli'
Name: !Sub '${AWS::StackName}-mitigate-sqli'
Predicates:
- Type: SqlInjectionMatch
Type: AWS::WAFRegional::Rule
Properties:
MetricName: 'mitigatesqli'
Name: !Sub '${AWS::StackName}-mitigate-sqli'
Predicates:
- Type: SqlInjectionMatch
Type: AWS::WAFRegional::Rule
Properties:
Name: !Sub ${StackPrefix}SecurityRule
MetricName: SecurityRule
Predicates:
- DataId: !Ref LimitRequestSize
"Type": "AWS::WAFRegional::Rule",
"Properties": {
"Name": "SQL Injection Rule",
"MetricName": "SqlInjRule",
"Predicates": [
{
"Type": "AWS::WAFRegional::Rule",
"Properties": {
"Name": "SQL Injection Rule",
"MetricName": "SqlInjRule",
"Predicates": [
{
"Type":"AWS::WAFRegional::Rule",
"Properties":{
"MetricName":"mitigatesqli",
"Name":"mitigate-sqli",
"Predicates":[{
"Type":"SqlInjectionMatch",
"Type": "AWS::WAFRegional::Rule",
"Properties": {
"Name": "${stack}-${instance}-size-restrictions-rule",
"MetricName": "${stack}${instance}SizeRestrictionsRule",
"Predicates": [
{
"Type": "AWS::WAFRegional::Rule",
"Properties": {
"Name": "MyIPSetRule",
"MetricName": "MyIPSetRule",
"Predicates": [
{
Parameters
-
MetricName
required - String -
Predicates
optional - List of Predicate -
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. A combination of
ByteMatchSet
,IPSet
, and/orSqlInjectionMatchSet
objects that identify the web requests that you want to allow, block, or count. For example, you might create aRule
that includes the following predicates:+ AnIPSet
that causes AWS WAF to search for web requests that originate from the IP address192.0.2.44
+ AByteMatchSet
that causes AWS WAF to search for web requests for which the value of theUser-Agent
header isBadBot
.To match the settings in this
Rule
, a request must originate from192.0.2.44
AND include aUser-Agent
header for which the value isBadBot
.
Frequently asked questions
What is AWS WAF Regional Regional Rule Group?
AWS WAF Regional Regional Rule Group is a resource for WAF Regional of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS WAF Regional Regional Rule Group?
For Terraform, the niveklabs/aws source code example is useful. See the Terraform Example section for further details.
For CloudFormation, the gandhi-mansi/csye6225-su19-ccwebapp, shubh1646/CSYE6225-ccwebapp and cyrilsebastian1811/Library-Management-System source code examples are useful. See the CloudFormation Example section for further details.