PARALLAX

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

NameTypeRequiredDefaultDescription
access_keystr
aws_ca_bundlepath
aws_configdict
capacityint
cloudwatch_metricsbooltrue
debug_botocore_endpoint_logsboolfalse
descriptionstr
endpoint_urlstr
metric_namestr
namestryes
profilestr
purge_rulesbooltrue
purge_tagsbooltrue
regionstr
ruleslist
sampled_requestsboolfalse
scopestryes
secret_keystr
session_tokenstr
statestryes
tagsdict
validate_certsbooltrue

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
Search
    ↑ ↓ move↵ openesc close