wafv2_rule_group
Create, update and delete AWS WAFv2 rule groups
Collection: community.aws
Full Name: community.aws.wafv2_rule_group
Synopsis
Create, update and delete AWS WAFv2 rule groups
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| capacity | int | |||
| cloudwatch_metrics | bool | true | ||
| debug_botocore_endpoint_logs | bool | false | ||
| description | str | |||
| endpoint_url | str | |||
| metric_name | str | |||
| name | str | yes | ||
| profile | str | |||
| purge_rules | bool | true | ||
| purge_tags | bool | true | ||
| region | str | |||
| rules | list | |||
| sampled_requests | bool | false | ||
| scope | str | yes | ||
| secret_key | str | |||
| session_token | str | |||
| state | str | yes | ||
| tags | dict | |||
| validate_certs | bool | true |
Example
yaml
- name: change description
community.aws.wafv2_rule_group:
name: test02
state: present
description: hallo eins zwei
scope: REGIONAL
capacity: 500
rules:
- name: eins
priority: 1
action:
allow: {}
visibility_config:
sampled_requests_enabled: true
cloud_watch_metrics_enabled: true
metric_name: fsd
statement:
ip_set_reference_statement:
arn: "{{ IPSET.arn }}"
cloudwatch_metrics: true
tags:
A: B
C: D
register: out
- name: add rule
community.aws.wafv2_rule_group:
name: test02
state: present
description: hallo eins zwei
scope: REGIONAL
capacity: 500
rules:
- name: eins
priority: 1
action:
allow: {}
visibility_config:
sampled_requests_enabled: true
cloud_watch_metrics_enabled: true
metric_name: fsd
statement:
ip_set_reference_statement:
arn: "{{ IPSET.arn }}"
- name: zwei
priority: 2
action:
block: {}
visibility_config:
sampled_requests_enabled: true
cloud_watch_metrics_enabled: true
metric_name: ddos
statement:
or_statement:
statements:
- byte_match_statement:
search_string: ansible.com
positional_constraint: CONTAINS
field_to_match:
single_header:
name: host
text_transformations:
- type: LOWERCASE
priority: 0
- xss_match_statement:
field_to_match:
body: {}
text_transformations:
- type: NONE
priority: 0
cloudwatch_metrics: true
tags:
A: B
C: D
register: out