We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Wafv2 logging error when using cloudtrail mode
### Describe the bug

When my wafv2 logging policy runs after disabling logging I receive an error on a cloudtrail policy when using the DeleteLoggingConfiguration event.

### What did you expect to happen?

I expected the policy to match my resource.

### Cloud Provider

Amazon Web Services (AWS)

### Cloud Custodian version and dependency information

```shell
custodian version --debug

Please copy/paste the following info along with any bug reports:

Custodian:   0.9.21
Python:      3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) 
             [Clang 6.0 (clang-600.0.57)]
Platform:    posix.uname_result(sysname='Darwin', nodename='kristen-MacBook-Pro', release='21.4.0', version='Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000', machine='x86_64')
Using venv:  True
Docker: False
Installed: 

argcomplete==2.0.0
attrs==22.1.0
boto3==1.26.30
botocore==1.29.30
docutils==0.17.1
importlib-metadata==4.13.0
importlib-resources==5.10.1
jmespath==1.0.1
jsonschema==4.17.3
pkgutil-resolve-name==1.3.10
pyrsistent==0.19.2
python-dateutil==2.8.2
pyyaml==6.0
s3transfer==0.6.0
six==1.16.0
tabulate==0.8.10
urllib3==1.26.13
zipp==3.11.0
```


### Policy

```shell
Policy example:

- name: wafv2-log-testing
  resource: aws.wafv2
  mode:
    role: arn:aws:iam::testing
    type: cloudtrail
    events: 
    - event: DeleteLoggingConfiguration
       ids: requestParameters.resourceArn
       source: wafv2.amazonaws.com
  filters: 
  - not:
      - type: logging
        key: ResourceArn
        value: present
```


### Relevant log/traceback output

```shell
Error when policy runs:


[ERROR]	2023-01-06T18:48:11.706Z	163a02a3-69d6-4d43-a307-365ddcb8ead7	error during policy executionTraceback (most recent call last):  File "/var/task/c7n/handler.py", line 165, in dispatch_event    p.push(event, context)  File "/var/task/c7n/policy.py", line 1288, in push    return mode.run(event, lambda_ctx)  File "/var/task/c7n/policy.py", line 487, in run    resources = self.resolve_resources(event)  File "/var/task/c7n/policy.py", line 691, in resolve_resources    return super().resolve_resources(event)  File "/var/task/c7n/policy.py", line 469, in resolve_resources    resources = self.policy.resource_manager.get_resources(resource_ids)  File "/var/task/c7n/query.py", line 576, in get_resources    resources = self.source.get_resources(ids)  File "/var/task/c7n/query.py", line 227, in get_resources    return self.query.get(self.manager, ids)  File "/var/task/c7n/query.py", line 100, in get    resources = self.filter(resource_manager, **params)  File "/var/task/c7n/query.py", line 79, in filter    return self._invoke_client_enum(  File "/var/task/c7n/query.py", line 60, in _invoke_client_enum    data = op(**params)  File "/var/runtime/botocore/client.py", line 391, in _api_call    return self._make_api_call(operation_name, kwargs)  File "/var/runtime/botocore/client.py", line 691, in _make_api_call    request_dict = self._convert_to_request_dict(  File "/var/runtime/botocore/client.py", line 739, in _convert_to_request_dict    request_dict = self._serializer.serialize_to_request(  File "/var/runtime/botocore/validate.py", line 360, in serialize_to_request    raise ParamValidationError(report=report.generate_report())botocore.exceptions.ParamValidationError: Parameter validation failed:Missing required parameter in input: "Scope" | [ERROR] 2023-01-06T18:48:11.706Z 163a02a3-69d6-4d43-a307-365ddcb8ead7 error during policy execution Traceback (most recent call last): File "/var/task/c7n/handler.py", line 165, in dispatch_event p.push(event, context) File "/var/task/c7n/policy.py", line 1288, in push return mode.run(event, lambda_ctx) File "/var/task/c7n/policy.py", line 487, in run resources = self.resolve_resources(event) File "/var/task/c7n/policy.py", line 691, in resolve_resources return super().resolve_resources(event) File "/var/task/c7n/policy.py", line 469, in resolve_resources resources = self.policy.resource_manager.get_resources(resource_ids) File "/var/task/c7n/query.py", line 576, in get_resources resources = self.source.get_resources(ids) File "/var/task/c7n/query.py", line 227, in get_resources return self.query.get(self.manager, ids) File "/var/task/c7n/query.py", line 100, in get resources = self.filter(resource_manager, **params) File "/var/task/c7n/query.py", line 79, in filter return self._invoke_client_enum( File "/var/task/c7n/query.py", line 60, in _invoke_client_enum data = op(**params) File "/var/runtime/botocore/client.py", line 391, in _api_call return self._make_api_call(operation_name, kwargs) File "/var/runtime/botocore/client.py", line 691, in _make_api_call request_dict = self._convert_to_request_dict( File "/var/runtime/botocore/client.py", line 739, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/var/runtime/botocore/validate.py", line 360, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Missing required parameter in input: "Scope"
-- | --
```


### Extra information or context

The pull mode version of this policy works fine.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `c7n/resources/waf.py`
Content:
```
1 # Copyright The Cloud Custodian Authors.
2 # SPDX-License-Identifier: Apache-2.0
3 from c7n.manager import resources
4 from c7n.query import ConfigSource, QueryResourceManager, TypeInfo, DescribeSource
5 from c7n.tags import universal_augment
6 from c7n.filters import ValueFilter
7 from c7n.utils import type_schema, local_session
8 
9 
10 class DescribeRegionalWaf(DescribeSource):
11     def augment(self, resources):
12         resources = super().augment(resources)
13         return universal_augment(self.manager, resources)
14 
15 
16 class DescribeWafV2(DescribeSource):
17     def augment(self, resources):
18         return universal_augment(self.manager, resources)
19 
20     # set REGIONAL for Scope as default
21     def get_query_params(self, query):
22         q = super(DescribeWafV2, self).get_query_params(query)
23         if q:
24             if 'Scope' not in q:
25                 q['Scope'] = 'REGIONAL'
26         else:
27             q = {'Scope': 'REGIONAL'}
28         return q
29 
30 
31 @resources.register('waf')
32 class WAF(QueryResourceManager):
33 
34     class resource_type(TypeInfo):
35         service = "waf"
36         enum_spec = ("list_web_acls", "WebACLs", None)
37         detail_spec = ("get_web_acl", "WebACLId", "WebACLId", "WebACL")
38         name = "Name"
39         id = "WebACLId"
40         dimension = "WebACL"
41         cfn_type = config_type = "AWS::WAF::WebACL"
42         arn_type = "webacl"
43         # override defaults to casing issues
44         permissions_enum = ('waf:ListWebACLs',)
45         permissions_augment = ('waf:GetWebACL',)
46 
47 
48 @resources.register('waf-regional')
49 class RegionalWAF(QueryResourceManager):
50 
51     class resource_type(TypeInfo):
52         service = "waf-regional"
53         enum_spec = ("list_web_acls", "WebACLs", None)
54         detail_spec = ("get_web_acl", "WebACLId", "WebACLId", "WebACL")
55         name = "Name"
56         id = "WebACLId"
57         dimension = "WebACL"
58         cfn_type = config_type = "AWS::WAFRegional::WebACL"
59         arn_type = "webacl"
60         # override defaults to casing issues
61         permissions_enum = ('waf-regional:ListWebACLs',)
62         permissions_augment = ('waf-regional:GetWebACL',)
63         universal_taggable = object()
64 
65     source_mapping = {
66         'describe': DescribeRegionalWaf,
67         'config': ConfigSource
68     }
69 
70 
71 @resources.register('wafv2')
72 class WAFV2(QueryResourceManager):
73 
74     class resource_type(TypeInfo):
75         service = "wafv2"
76         enum_spec = ("list_web_acls", "WebACLs", None)
77         detail_spec = ("get_web_acl", "Id", "Id", "WebACL")
78         name = "Name"
79         id = "Id"
80         dimension = "WebACL"
81         cfn_type = config_type = "AWS::WAFv2::WebACL"
82         arn_type = "webacl"
83         # override defaults to casing issues
84         permissions_enum = ('wafv2:ListWebACLs',)
85         permissions_augment = ('wafv2:GetWebACL',)
86         universal_taggable = object()
87 
88     source_mapping = {
89         'describe': DescribeWafV2,
90         'config': ConfigSource
91     }
92 
93 
94 @WAFV2.filter_registry.register('logging')
95 class WAFV2LoggingFilter(ValueFilter):
96     """
97     Filter by wafv2 logging configuration
98 
99     :example:
100 
101     .. code-block:: yaml
102 
103         policies:
104           - name: wafv2-logging-enabled
105             resource: aws.wafv2
106             filters:
107               - not:
108                   - type: logging
109                     key: ResourceArn
110                     value: present
111 
112           - name: check-redacted-fields
113             resource: aws.wafv2
114             filters:
115               - type: logging
116                 key: RedactedFields[].SingleHeader.Name
117                 value: user-agent
118                 op: in
119                 value_type: swap
120     """
121 
122     schema = type_schema('logging', rinherit=ValueFilter.schema)
123     permissions = ('wafv2:GetLoggingConfiguration', )
124     annotation_key = 'c7n:WafV2LoggingConfiguration'
125 
126     def process(self, resources, event=None):
127         client = local_session(self.manager.session_factory).client(
128             'wafv2', region_name=self.manager.region)
129         logging_confs = client.list_logging_configurations(
130             Scope='REGIONAL')['LoggingConfigurations']
131         resource_map = {r['ARN']: r for r in resources}
132         for lc in logging_confs:
133             if lc['ResourceArn'] in resource_map:
134                 resource_map[lc['ResourceArn']][self.annotation_key] = lc
135 
136         resources = list(resource_map.values())
137 
138         return [
139             r for r in resources if self.match(
140                 r.get(self.annotation_key, {}))]
141
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/c7n/resources/waf.py b/c7n/resources/waf.py
--- a/c7n/resources/waf.py
+++ b/c7n/resources/waf.py
@@ -27,6 +27,10 @@
             q = {'Scope': 'REGIONAL'}
         return q
 
+    def get_resources(self, ids):
+        resources = self.query.filter(self.manager, **self.get_query_params(None))
+        return [r for r in resources if r[self.manager.resource_type.id] in ids]
+
 
 @resources.register('waf')
 class WAF(QueryResourceManager):

{"golden_diff": "diff --git a/c7n/resources/waf.py b/c7n/resources/waf.py\n--- a/c7n/resources/waf.py\n+++ b/c7n/resources/waf.py\n@@ -27,6 +27,10 @@\n             q = {'Scope': 'REGIONAL'}\n         return q\n \n+    def get_resources(self, ids):\n+        resources = self.query.filter(self.manager, **self.get_query_params(None))\n+        return [r for r in resources if r[self.manager.resource_type.id] in ids]\n+\n \n @resources.register('waf')\n class WAF(QueryResourceManager):\n", "issue": "Wafv2 logging error when using cloudtrail mode\n### Describe the bug\n\nWhen my wafv2 logging policy runs after disabling logging I receive an error on a cloudtrail policy when using the DeleteLoggingConfiguration event.\n\n### What did you expect to happen?\n\nI expected the policy to match my resource.\n\n### Cloud Provider\n\nAmazon Web Services (AWS)\n\n### Cloud Custodian version and dependency information\n\n```shell\ncustodian version --debug\r\n\r\nPlease copy/paste the following info along with any bug reports:\r\n\r\nCustodian:   0.9.21\r\nPython:      3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) \r\n             [Clang 6.0 (clang-600.0.57)]\r\nPlatform:    posix.uname_result(sysname='Darwin', nodename='kristen-MacBook-Pro', release='21.4.0', version='Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000', machine='x86_64')\r\nUsing venv:  True\r\nDocker: False\r\nInstalled: \r\n\r\nargcomplete==2.0.0\r\nattrs==22.1.0\r\nboto3==1.26.30\r\nbotocore==1.29.30\r\ndocutils==0.17.1\r\nimportlib-metadata==4.13.0\r\nimportlib-resources==5.10.1\r\njmespath==1.0.1\r\njsonschema==4.17.3\r\npkgutil-resolve-name==1.3.10\r\npyrsistent==0.19.2\r\npython-dateutil==2.8.2\r\npyyaml==6.0\r\ns3transfer==0.6.0\r\nsix==1.16.0\r\ntabulate==0.8.10\r\nurllib3==1.26.13\r\nzipp==3.11.0\n```\n\n\n### Policy\n\n```shell\nPolicy example:\r\n\r\n- name: wafv2-log-testing\r\n  resource: aws.wafv2\r\n  mode:\r\n    role: arn:aws:iam::testing\r\n    type: cloudtrail\r\n    events: \r\n    - event: DeleteLoggingConfiguration\r\n       ids: requestParameters.resourceArn\r\n       source: wafv2.amazonaws.com\r\n  filters: \r\n  - not:\r\n      - type: logging\r\n        key: ResourceArn\r\n        value: present\n```\n\n\n### Relevant log/traceback output\n\n```shell\nError when policy runs:\r\n\r\n\r\n[ERROR]\t2023-01-06T18:48:11.706Z\t163a02a3-69d6-4d43-a307-365ddcb8ead7\terror during policy executionTraceback (most recent call last):  File \"/var/task/c7n/handler.py\", line 165, in dispatch_event    p.push(event, context)  File \"/var/task/c7n/policy.py\", line 1288, in push    return mode.run(event, lambda_ctx)  File \"/var/task/c7n/policy.py\", line 487, in run    resources = self.resolve_resources(event)  File \"/var/task/c7n/policy.py\", line 691, in resolve_resources    return super().resolve_resources(event)  File \"/var/task/c7n/policy.py\", line 469, in resolve_resources    resources = self.policy.resource_manager.get_resources(resource_ids)  File \"/var/task/c7n/query.py\", line 576, in get_resources    resources = self.source.get_resources(ids)  File \"/var/task/c7n/query.py\", line 227, in get_resources    return self.query.get(self.manager, ids)  File \"/var/task/c7n/query.py\", line 100, in get    resources = self.filter(resource_manager, **params)  File \"/var/task/c7n/query.py\", line 79, in filter    return self._invoke_client_enum(  File \"/var/task/c7n/query.py\", line 60, in _invoke_client_enum    data = op(**params)  File \"/var/runtime/botocore/client.py\", line 391, in _api_call    return self._make_api_call(operation_name, kwargs)  File \"/var/runtime/botocore/client.py\", line 691, in _make_api_call    request_dict = self._convert_to_request_dict(  File \"/var/runtime/botocore/client.py\", line 739, in _convert_to_request_dict    request_dict = self._serializer.serialize_to_request(  File \"/var/runtime/botocore/validate.py\", line 360, in serialize_to_request    raise ParamValidationError(report=report.generate_report())botocore.exceptions.ParamValidationError: Parameter validation failed:Missing required parameter in input: \"Scope\" | [ERROR] 2023-01-06T18:48:11.706Z 163a02a3-69d6-4d43-a307-365ddcb8ead7 error during policy execution Traceback (most recent call last): File \"/var/task/c7n/handler.py\", line 165, in dispatch_event p.push(event, context) File \"/var/task/c7n/policy.py\", line 1288, in push return mode.run(event, lambda_ctx) File \"/var/task/c7n/policy.py\", line 487, in run resources = self.resolve_resources(event) File \"/var/task/c7n/policy.py\", line 691, in resolve_resources return super().resolve_resources(event) File \"/var/task/c7n/policy.py\", line 469, in resolve_resources resources = self.policy.resource_manager.get_resources(resource_ids) File \"/var/task/c7n/query.py\", line 576, in get_resources resources = self.source.get_resources(ids) File \"/var/task/c7n/query.py\", line 227, in get_resources return self.query.get(self.manager, ids) File \"/var/task/c7n/query.py\", line 100, in get resources = self.filter(resource_manager, **params) File \"/var/task/c7n/query.py\", line 79, in filter return self._invoke_client_enum( File \"/var/task/c7n/query.py\", line 60, in _invoke_client_enum data = op(**params) File \"/var/runtime/botocore/client.py\", line 391, in _api_call return self._make_api_call(operation_name, kwargs) File \"/var/runtime/botocore/client.py\", line 691, in _make_api_call request_dict = self._convert_to_request_dict( File \"/var/runtime/botocore/client.py\", line 739, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File \"/var/runtime/botocore/validate.py\", line 360, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Missing required parameter in input: \"Scope\"\r\n-- | --\n```\n\n\n### Extra information or context\n\nThe pull mode version of this policy works fine.\n", "before_files": [{"content": "# Copyright The Cloud Custodian Authors.\n# SPDX-License-Identifier: Apache-2.0\nfrom c7n.manager import resources\nfrom c7n.query import ConfigSource, QueryResourceManager, TypeInfo, DescribeSource\nfrom c7n.tags import universal_augment\nfrom c7n.filters import ValueFilter\nfrom c7n.utils import type_schema, local_session\n\n\nclass DescribeRegionalWaf(DescribeSource):\n    def augment(self, resources):\n        resources = super().augment(resources)\n        return universal_augment(self.manager, resources)\n\n\nclass DescribeWafV2(DescribeSource):\n    def augment(self, resources):\n        return universal_augment(self.manager, resources)\n\n    # set REGIONAL for Scope as default\n    def get_query_params(self, query):\n        q = super(DescribeWafV2, self).get_query_params(query)\n        if q:\n            if 'Scope' not in q:\n                q['Scope'] = 'REGIONAL'\n        else:\n            q = {'Scope': 'REGIONAL'}\n        return q\n\n\n@resources.register('waf')\nclass WAF(QueryResourceManager):\n\n    class resource_type(TypeInfo):\n        service = \"waf\"\n        enum_spec = (\"list_web_acls\", \"WebACLs\", None)\n        detail_spec = (\"get_web_acl\", \"WebACLId\", \"WebACLId\", \"WebACL\")\n        name = \"Name\"\n        id = \"WebACLId\"\n        dimension = \"WebACL\"\n        cfn_type = config_type = \"AWS::WAF::WebACL\"\n        arn_type = \"webacl\"\n        # override defaults to casing issues\n        permissions_enum = ('waf:ListWebACLs',)\n        permissions_augment = ('waf:GetWebACL',)\n\n\n@resources.register('waf-regional')\nclass RegionalWAF(QueryResourceManager):\n\n    class resource_type(TypeInfo):\n        service = \"waf-regional\"\n        enum_spec = (\"list_web_acls\", \"WebACLs\", None)\n        detail_spec = (\"get_web_acl\", \"WebACLId\", \"WebACLId\", \"WebACL\")\n        name = \"Name\"\n        id = \"WebACLId\"\n        dimension = \"WebACL\"\n        cfn_type = config_type = \"AWS::WAFRegional::WebACL\"\n        arn_type = \"webacl\"\n        # override defaults to casing issues\n        permissions_enum = ('waf-regional:ListWebACLs',)\n        permissions_augment = ('waf-regional:GetWebACL',)\n        universal_taggable = object()\n\n    source_mapping = {\n        'describe': DescribeRegionalWaf,\n        'config': ConfigSource\n    }\n\n\n@resources.register('wafv2')\nclass WAFV2(QueryResourceManager):\n\n    class resource_type(TypeInfo):\n        service = \"wafv2\"\n        enum_spec = (\"list_web_acls\", \"WebACLs\", None)\n        detail_spec = (\"get_web_acl\", \"Id\", \"Id\", \"WebACL\")\n        name = \"Name\"\n        id = \"Id\"\n        dimension = \"WebACL\"\n        cfn_type = config_type = \"AWS::WAFv2::WebACL\"\n        arn_type = \"webacl\"\n        # override defaults to casing issues\n        permissions_enum = ('wafv2:ListWebACLs',)\n        permissions_augment = ('wafv2:GetWebACL',)\n        universal_taggable = object()\n\n    source_mapping = {\n        'describe': DescribeWafV2,\n        'config': ConfigSource\n    }\n\n\n@WAFV2.filter_registry.register('logging')\nclass WAFV2LoggingFilter(ValueFilter):\n    \"\"\"\n    Filter by wafv2 logging configuration\n\n    :example:\n\n    .. code-block:: yaml\n\n        policies:\n          - name: wafv2-logging-enabled\n            resource: aws.wafv2\n            filters:\n              - not:\n                  - type: logging\n                    key: ResourceArn\n                    value: present\n\n          - name: check-redacted-fields\n            resource: aws.wafv2\n            filters:\n              - type: logging\n                key: RedactedFields[].SingleHeader.Name\n                value: user-agent\n                op: in\n                value_type: swap\n    \"\"\"\n\n    schema = type_schema('logging', rinherit=ValueFilter.schema)\n    permissions = ('wafv2:GetLoggingConfiguration', )\n    annotation_key = 'c7n:WafV2LoggingConfiguration'\n\n    def process(self, resources, event=None):\n        client = local_session(self.manager.session_factory).client(\n            'wafv2', region_name=self.manager.region)\n        logging_confs = client.list_logging_configurations(\n            Scope='REGIONAL')['LoggingConfigurations']\n        resource_map = {r['ARN']: r for r in resources}\n        for lc in logging_confs:\n            if lc['ResourceArn'] in resource_map:\n                resource_map[lc['ResourceArn']][self.annotation_key] = lc\n\n        resources = list(resource_map.values())\n\n        return [\n            r for r in resources if self.match(\n                r.get(self.annotation_key, {}))]\n", "path": "c7n/resources/waf.py"}], "after_files": [{"content": "# Copyright The Cloud Custodian Authors.\n# SPDX-License-Identifier: Apache-2.0\nfrom c7n.manager import resources\nfrom c7n.query import ConfigSource, QueryResourceManager, TypeInfo, DescribeSource\nfrom c7n.tags import universal_augment\nfrom c7n.filters import ValueFilter\nfrom c7n.utils import type_schema, local_session\n\n\nclass DescribeRegionalWaf(DescribeSource):\n    def augment(self, resources):\n        resources = super().augment(resources)\n        return universal_augment(self.manager, resources)\n\n\nclass DescribeWafV2(DescribeSource):\n    def augment(self, resources):\n        return universal_augment(self.manager, resources)\n\n    # set REGIONAL for Scope as default\n    def get_query_params(self, query):\n        q = super(DescribeWafV2, self).get_query_params(query)\n        if q:\n            if 'Scope' not in q:\n                q['Scope'] = 'REGIONAL'\n        else:\n            q = {'Scope': 'REGIONAL'}\n        return q\n\n    def get_resources(self, ids):\n        resources = self.query.filter(self.manager, **self.get_query_params(None))\n        return [r for r in resources if r[self.manager.resource_type.id] in ids]\n\n\n@resources.register('waf')\nclass WAF(QueryResourceManager):\n\n    class resource_type(TypeInfo):\n        service = \"waf\"\n        enum_spec = (\"list_web_acls\", \"WebACLs\", None)\n        detail_spec = (\"get_web_acl\", \"WebACLId\", \"WebACLId\", \"WebACL\")\n        name = \"Name\"\n        id = \"WebACLId\"\n        dimension = \"WebACL\"\n        cfn_type = config_type = \"AWS::WAF::WebACL\"\n        arn_type = \"webacl\"\n        # override defaults to casing issues\n        permissions_enum = ('waf:ListWebACLs',)\n        permissions_augment = ('waf:GetWebACL',)\n\n\n@resources.register('waf-regional')\nclass RegionalWAF(QueryResourceManager):\n\n    class resource_type(TypeInfo):\n        service = \"waf-regional\"\n        enum_spec = (\"list_web_acls\", \"WebACLs\", None)\n        detail_spec = (\"get_web_acl\", \"WebACLId\", \"WebACLId\", \"WebACL\")\n        name = \"Name\"\n        id = \"WebACLId\"\n        dimension = \"WebACL\"\n        cfn_type = config_type = \"AWS::WAFRegional::WebACL\"\n        arn_type = \"webacl\"\n        # override defaults to casing issues\n        permissions_enum = ('waf-regional:ListWebACLs',)\n        permissions_augment = ('waf-regional:GetWebACL',)\n        universal_taggable = object()\n\n    source_mapping = {\n        'describe': DescribeRegionalWaf,\n        'config': ConfigSource\n    }\n\n\n@resources.register('wafv2')\nclass WAFV2(QueryResourceManager):\n\n    class resource_type(TypeInfo):\n        service = \"wafv2\"\n        enum_spec = (\"list_web_acls\", \"WebACLs\", None)\n        detail_spec = (\"get_web_acl\", \"Id\", \"Id\", \"WebACL\")\n        name = \"Name\"\n        id = \"Id\"\n        dimension = \"WebACL\"\n        cfn_type = config_type = \"AWS::WAFv2::WebACL\"\n        arn_type = \"webacl\"\n        # override defaults to casing issues\n        permissions_enum = ('wafv2:ListWebACLs',)\n        permissions_augment = ('wafv2:GetWebACL',)\n        universal_taggable = object()\n\n    source_mapping = {\n        'describe': DescribeWafV2,\n        'config': ConfigSource\n    }\n\n\n@WAFV2.filter_registry.register('logging')\nclass WAFV2LoggingFilter(ValueFilter):\n    \"\"\"\n    Filter by wafv2 logging configuration\n\n    :example:\n\n    .. code-block:: yaml\n\n        policies:\n          - name: wafv2-logging-enabled\n            resource: aws.wafv2\n            filters:\n              - not:\n                  - type: logging\n                    key: ResourceArn\n                    value: present\n\n          - name: check-redacted-fields\n            resource: aws.wafv2\n            filters:\n              - type: logging\n                key: RedactedFields[].SingleHeader.Name\n                value: user-agent\n                op: in\n                value_type: swap\n    \"\"\"\n\n    schema = type_schema('logging', rinherit=ValueFilter.schema)\n    permissions = ('wafv2:GetLoggingConfiguration', )\n    annotation_key = 'c7n:WafV2LoggingConfiguration'\n\n    def process(self, resources, event=None):\n        client = local_session(self.manager.session_factory).client(\n            'wafv2', region_name=self.manager.region)\n        logging_confs = client.list_logging_configurations(\n            Scope='REGIONAL')['LoggingConfigurations']\n        resource_map = {r['ARN']: r for r in resources}\n        for lc in logging_confs:\n            if lc['ResourceArn'] in resource_map:\n                resource_map[lc['ResourceArn']][self.annotation_key] = lc\n\n        resources = list(resource_map.values())\n\n        return [\n            r for r in resources if self.match(\n                r.get(self.annotation_key, {}))]\n", "path": "c7n/resources/waf.py"}]}