We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
AWS common filters page has a link pointing to 404 link
On this page: https://cloudcustodian.io/docs/aws/resources/aws-common-filters.html#aws-common-filters-config-compliance

There is a bit.ly link: https://bit.ly/2mblVpq

The bit.ly link points to a non-existent capitalone.github.io link (throws 404): http://capitalone.github.io/cloud-custodian/docs/policy/lambda.html#config-rules

I believe the bit.ly link should be updated to point to this page in the cloud custodian docs: https://cloudcustodian.io/docs/policy/lambda.html#config-rules
AWS common filters page has a link pointing to 404 link
On this page: https://cloudcustodian.io/docs/aws/resources/aws-common-filters.html#aws-common-filters-config-compliance

There is a bit.ly link: https://bit.ly/2mblVpq

The bit.ly link points to a non-existent capitalone.github.io link (throws 404): http://capitalone.github.io/cloud-custodian/docs/policy/lambda.html#config-rules

I believe the bit.ly link should be updated to point to this page in the cloud custodian docs: https://cloudcustodian.io/docs/policy/lambda.html#config-rules

--- 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/filters/config.py`
Content:
```
1 # Copyright 2018 Capital One Services, LLC
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 from c7n.filters import ValueFilter
15 from c7n.manager import resources
16 from c7n.utils import local_session, type_schema
17 
18 from .core import Filter
19 
20 
21 class ConfigCompliance(Filter):
22     """Filter resources by their compliance with one or more AWS config rules.
23 
24     An example of using the filter to find all ec2 instances that have
25     been registered as non compliant in the last 30 days against two
26     custom AWS Config rules.
27 
28     :example:
29 
30     .. code-block:: yaml
31 
32        policies:
33          - name: non-compliant-ec2
34            resource: ec2
35            filters:
36             - type: config-compliance
37               eval_filters:
38                - type: value
39                  key: ResultRecordedTime
40                  value_type: age
41                  value: 30
42                  op: less-than
43               rules:
44                - custodian-ec2-encryption-required
45                - custodian-ec2-tags-required
46 
47     Also note, custodian has direct support for deploying policies as config
48     rules see https://bit.ly/2mblVpq
49     """
50     permissions = ('config:DescribeComplianceByConfigRule',)
51     schema = type_schema(
52         'config-compliance',
53         required=('rules',),
54         op={'enum': ['or', 'and']},
55         eval_filters={'type': 'array', 'items': {
56             'oneOf': [
57                 {'$ref': '#/definitions/filters/valuekv'},
58                 {'$ref': '#/definitions/filters/value'}]}},
59         states={'type': 'array', 'items': {'enum': [
60             'COMPLIANT', 'NON_COMPLIANT',
61             'NOT_APPLICABLE', 'INSUFFICIENT_DATA']}},
62         rules={'type': 'array', 'items': {'type': 'string'}})
63     schema_alias = True
64     annotation_key = 'c7n:config-compliance'
65 
66     def get_resource_map(self, filters, resource_model, resources):
67         rule_ids = self.data.get('rules')
68         states = self.data.get('states', ['NON_COMPLIANT'])
69         op = self.data.get('op', 'or') == 'or' and any or all
70 
71         client = local_session(self.manager.session_factory).client('config')
72         resource_map = {}
73 
74         for rid in rule_ids:
75             pager = client.get_paginator('get_compliance_details_by_config_rule')
76             for page in pager.paginate(
77                     ConfigRuleName=rid, ComplianceTypes=states):
78                 evaluations = page.get('EvaluationResults', ())
79 
80                 for e in evaluations:
81                     rident = e['EvaluationResultIdentifier'][
82                         'EvaluationResultQualifier']
83                     # for multi resource type rules, only look at
84                     # results for the resource type currently being
85                     # processed.
86                     if rident['ResourceType'] not in (
87                             resource_model.config_type,
88                             resource_model.cfn_type):
89                         continue
90 
91                     if not filters:
92                         resource_map.setdefault(
93                             rident['ResourceId'], []).append(e)
94                         continue
95 
96                     if op([f.match(e) for f in filters]):
97                         resource_map.setdefault(
98                             rident['ResourceId'], []).append(e)
99 
100         return resource_map
101 
102     def process(self, resources, event=None):
103         filters = []
104         for f in self.data.get('eval_filters', ()):
105             vf = ValueFilter(f)
106             vf.annotate = False
107             filters.append(vf)
108 
109         resource_model = self.manager.get_model()
110         resource_map = self.get_resource_map(filters, resource_model, resources)
111 
112         # Avoid static/import time dep on boto in filters package
113         from c7n.resources.aws import Arn
114         results = []
115         for arn, r in zip(self.manager.get_arns(resources), resources):
116             # many aws provided rules are inconsistent in their
117             # treatment of resource ids, some use arns, some use names
118             # as identifiers for the same resource type. security
119             # hub in particular is bad at consistency.
120             rid = None
121             if arn in resource_map:
122                 rid = arn
123             elif r[resource_model.id] in resource_map:
124                 rid = r[resource_model.id]
125             if arn == r[resource_model.id] and not rid:
126                 rid = Arn.parse(arn).resource
127                 if rid not in resource_map:
128                     rid = None
129             if rid is None:
130                 continue
131             r[self.annotation_key] = resource_map[rid]
132             results.append(r)
133         return results
134 
135     @classmethod
136     def register_resources(klass, registry, resource_class):
137         """model resource subscriber on resource registration.
138 
139         Watch for new resource types being registered if they are
140         supported by aws config, automatically, register the
141         config-compliance filter.
142         """
143         if (resource_class.resource_type.cfn_type is None and
144                 resource_class.resource_type.config_type is None):
145             return
146         resource_class.filter_registry.register('config-compliance', klass)
147 
148 
149 resources.subscribe(ConfigCompliance.register_resources)
150
```
--- 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/filters/config.py b/c7n/filters/config.py
--- a/c7n/filters/config.py
+++ b/c7n/filters/config.py
@@ -45,7 +45,7 @@
                - custodian-ec2-tags-required
 
     Also note, custodian has direct support for deploying policies as config
-    rules see https://bit.ly/2mblVpq
+    rules see https://cloudcustodian.io/docs/policy/lambda.html#config-rules
     """
     permissions = ('config:DescribeComplianceByConfigRule',)
     schema = type_schema(

{"golden_diff": "diff --git a/c7n/filters/config.py b/c7n/filters/config.py\n--- a/c7n/filters/config.py\n+++ b/c7n/filters/config.py\n@@ -45,7 +45,7 @@\n                - custodian-ec2-tags-required\n \n     Also note, custodian has direct support for deploying policies as config\n-    rules see https://bit.ly/2mblVpq\n+    rules see https://cloudcustodian.io/docs/policy/lambda.html#config-rules\n     \"\"\"\n     permissions = ('config:DescribeComplianceByConfigRule',)\n     schema = type_schema(\n", "issue": "AWS common filters page has a link pointing to 404 link\nOn this page: https://cloudcustodian.io/docs/aws/resources/aws-common-filters.html#aws-common-filters-config-compliance\r\n\r\nThere is a bit.ly link: https://bit.ly/2mblVpq\r\n\r\nThe bit.ly link points to a non-existent capitalone.github.io link (throws 404): http://capitalone.github.io/cloud-custodian/docs/policy/lambda.html#config-rules\r\n\r\nI believe the bit.ly link should be updated to point to this page in the cloud custodian docs: https://cloudcustodian.io/docs/policy/lambda.html#config-rules\nAWS common filters page has a link pointing to 404 link\nOn this page: https://cloudcustodian.io/docs/aws/resources/aws-common-filters.html#aws-common-filters-config-compliance\r\n\r\nThere is a bit.ly link: https://bit.ly/2mblVpq\r\n\r\nThe bit.ly link points to a non-existent capitalone.github.io link (throws 404): http://capitalone.github.io/cloud-custodian/docs/policy/lambda.html#config-rules\r\n\r\nI believe the bit.ly link should be updated to point to this page in the cloud custodian docs: https://cloudcustodian.io/docs/policy/lambda.html#config-rules\n", "before_files": [{"content": "# Copyright 2018 Capital One Services, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom c7n.filters import ValueFilter\nfrom c7n.manager import resources\nfrom c7n.utils import local_session, type_schema\n\nfrom .core import Filter\n\n\nclass ConfigCompliance(Filter):\n    \"\"\"Filter resources by their compliance with one or more AWS config rules.\n\n    An example of using the filter to find all ec2 instances that have\n    been registered as non compliant in the last 30 days against two\n    custom AWS Config rules.\n\n    :example:\n\n    .. code-block:: yaml\n\n       policies:\n         - name: non-compliant-ec2\n           resource: ec2\n           filters:\n            - type: config-compliance\n              eval_filters:\n               - type: value\n                 key: ResultRecordedTime\n                 value_type: age\n                 value: 30\n                 op: less-than\n              rules:\n               - custodian-ec2-encryption-required\n               - custodian-ec2-tags-required\n\n    Also note, custodian has direct support for deploying policies as config\n    rules see https://bit.ly/2mblVpq\n    \"\"\"\n    permissions = ('config:DescribeComplianceByConfigRule',)\n    schema = type_schema(\n        'config-compliance',\n        required=('rules',),\n        op={'enum': ['or', 'and']},\n        eval_filters={'type': 'array', 'items': {\n            'oneOf': [\n                {'$ref': '#/definitions/filters/valuekv'},\n                {'$ref': '#/definitions/filters/value'}]}},\n        states={'type': 'array', 'items': {'enum': [\n            'COMPLIANT', 'NON_COMPLIANT',\n            'NOT_APPLICABLE', 'INSUFFICIENT_DATA']}},\n        rules={'type': 'array', 'items': {'type': 'string'}})\n    schema_alias = True\n    annotation_key = 'c7n:config-compliance'\n\n    def get_resource_map(self, filters, resource_model, resources):\n        rule_ids = self.data.get('rules')\n        states = self.data.get('states', ['NON_COMPLIANT'])\n        op = self.data.get('op', 'or') == 'or' and any or all\n\n        client = local_session(self.manager.session_factory).client('config')\n        resource_map = {}\n\n        for rid in rule_ids:\n            pager = client.get_paginator('get_compliance_details_by_config_rule')\n            for page in pager.paginate(\n                    ConfigRuleName=rid, ComplianceTypes=states):\n                evaluations = page.get('EvaluationResults', ())\n\n                for e in evaluations:\n                    rident = e['EvaluationResultIdentifier'][\n                        'EvaluationResultQualifier']\n                    # for multi resource type rules, only look at\n                    # results for the resource type currently being\n                    # processed.\n                    if rident['ResourceType'] not in (\n                            resource_model.config_type,\n                            resource_model.cfn_type):\n                        continue\n\n                    if not filters:\n                        resource_map.setdefault(\n                            rident['ResourceId'], []).append(e)\n                        continue\n\n                    if op([f.match(e) for f in filters]):\n                        resource_map.setdefault(\n                            rident['ResourceId'], []).append(e)\n\n        return resource_map\n\n    def process(self, resources, event=None):\n        filters = []\n        for f in self.data.get('eval_filters', ()):\n            vf = ValueFilter(f)\n            vf.annotate = False\n            filters.append(vf)\n\n        resource_model = self.manager.get_model()\n        resource_map = self.get_resource_map(filters, resource_model, resources)\n\n        # Avoid static/import time dep on boto in filters package\n        from c7n.resources.aws import Arn\n        results = []\n        for arn, r in zip(self.manager.get_arns(resources), resources):\n            # many aws provided rules are inconsistent in their\n            # treatment of resource ids, some use arns, some use names\n            # as identifiers for the same resource type. security\n            # hub in particular is bad at consistency.\n            rid = None\n            if arn in resource_map:\n                rid = arn\n            elif r[resource_model.id] in resource_map:\n                rid = r[resource_model.id]\n            if arn == r[resource_model.id] and not rid:\n                rid = Arn.parse(arn).resource\n                if rid not in resource_map:\n                    rid = None\n            if rid is None:\n                continue\n            r[self.annotation_key] = resource_map[rid]\n            results.append(r)\n        return results\n\n    @classmethod\n    def register_resources(klass, registry, resource_class):\n        \"\"\"model resource subscriber on resource registration.\n\n        Watch for new resource types being registered if they are\n        supported by aws config, automatically, register the\n        config-compliance filter.\n        \"\"\"\n        if (resource_class.resource_type.cfn_type is None and\n                resource_class.resource_type.config_type is None):\n            return\n        resource_class.filter_registry.register('config-compliance', klass)\n\n\nresources.subscribe(ConfigCompliance.register_resources)\n", "path": "c7n/filters/config.py"}], "after_files": [{"content": "# Copyright 2018 Capital One Services, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom c7n.filters import ValueFilter\nfrom c7n.manager import resources\nfrom c7n.utils import local_session, type_schema\n\nfrom .core import Filter\n\n\nclass ConfigCompliance(Filter):\n    \"\"\"Filter resources by their compliance with one or more AWS config rules.\n\n    An example of using the filter to find all ec2 instances that have\n    been registered as non compliant in the last 30 days against two\n    custom AWS Config rules.\n\n    :example:\n\n    .. code-block:: yaml\n\n       policies:\n         - name: non-compliant-ec2\n           resource: ec2\n           filters:\n            - type: config-compliance\n              eval_filters:\n               - type: value\n                 key: ResultRecordedTime\n                 value_type: age\n                 value: 30\n                 op: less-than\n              rules:\n               - custodian-ec2-encryption-required\n               - custodian-ec2-tags-required\n\n    Also note, custodian has direct support for deploying policies as config\n    rules see https://cloudcustodian.io/docs/policy/lambda.html#config-rules\n    \"\"\"\n    permissions = ('config:DescribeComplianceByConfigRule',)\n    schema = type_schema(\n        'config-compliance',\n        required=('rules',),\n        op={'enum': ['or', 'and']},\n        eval_filters={'type': 'array', 'items': {\n            'oneOf': [\n                {'$ref': '#/definitions/filters/valuekv'},\n                {'$ref': '#/definitions/filters/value'}]}},\n        states={'type': 'array', 'items': {'enum': [\n            'COMPLIANT', 'NON_COMPLIANT',\n            'NOT_APPLICABLE', 'INSUFFICIENT_DATA']}},\n        rules={'type': 'array', 'items': {'type': 'string'}})\n    schema_alias = True\n    annotation_key = 'c7n:config-compliance'\n\n    def get_resource_map(self, filters, resource_model, resources):\n        rule_ids = self.data.get('rules')\n        states = self.data.get('states', ['NON_COMPLIANT'])\n        op = self.data.get('op', 'or') == 'or' and any or all\n\n        client = local_session(self.manager.session_factory).client('config')\n        resource_map = {}\n\n        for rid in rule_ids:\n            pager = client.get_paginator('get_compliance_details_by_config_rule')\n            for page in pager.paginate(\n                    ConfigRuleName=rid, ComplianceTypes=states):\n                evaluations = page.get('EvaluationResults', ())\n\n                for e in evaluations:\n                    rident = e['EvaluationResultIdentifier'][\n                        'EvaluationResultQualifier']\n                    # for multi resource type rules, only look at\n                    # results for the resource type currently being\n                    # processed.\n                    if rident['ResourceType'] not in (\n                            resource_model.config_type,\n                            resource_model.cfn_type):\n                        continue\n\n                    if not filters:\n                        resource_map.setdefault(\n                            rident['ResourceId'], []).append(e)\n                        continue\n\n                    if op([f.match(e) for f in filters]):\n                        resource_map.setdefault(\n                            rident['ResourceId'], []).append(e)\n\n        return resource_map\n\n    def process(self, resources, event=None):\n        filters = []\n        for f in self.data.get('eval_filters', ()):\n            vf = ValueFilter(f)\n            vf.annotate = False\n            filters.append(vf)\n\n        resource_model = self.manager.get_model()\n        resource_map = self.get_resource_map(filters, resource_model, resources)\n\n        # Avoid static/import time dep on boto in filters package\n        from c7n.resources.aws import Arn\n        results = []\n        for arn, r in zip(self.manager.get_arns(resources), resources):\n            # many aws provided rules are inconsistent in their\n            # treatment of resource ids, some use arns, some use names\n            # as identifiers for the same resource type. security\n            # hub in particular is bad at consistency.\n            rid = None\n            if arn in resource_map:\n                rid = arn\n            elif r[resource_model.id] in resource_map:\n                rid = r[resource_model.id]\n            if arn == r[resource_model.id] and not rid:\n                rid = Arn.parse(arn).resource\n                if rid not in resource_map:\n                    rid = None\n            if rid is None:\n                continue\n            r[self.annotation_key] = resource_map[rid]\n            results.append(r)\n        return results\n\n    @classmethod\n    def register_resources(klass, registry, resource_class):\n        \"\"\"model resource subscriber on resource registration.\n\n        Watch for new resource types being registered if they are\n        supported by aws config, automatically, register the\n        config-compliance filter.\n        \"\"\"\n        if (resource_class.resource_type.cfn_type is None and\n                resource_class.resource_type.config_type is None):\n            return\n        resource_class.filter_registry.register('config-compliance', klass)\n\n\nresources.subscribe(ConfigCompliance.register_resources)\n", "path": "c7n/filters/config.py"}]}