Skip to content

Commit a1c8868

Browse files
authored
Add SES exception for boto MatchingEventTypes (#3843)
* Turn MatchingEventTypes into an exception
1 parent 6846123 commit a1c8868

File tree

4 files changed

+13
-27
lines changed

4 files changed

+13
-27
lines changed

scripts/boto/_automated_patches.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from _types import AllPatches, Patch, ResourcePatches
1111

12-
from cfnlint.schema.resolver import RefResolver
12+
from cfnlint.schema.resolver import RefResolutionError, RefResolver
1313

1414
skip = [
1515
"account",
@@ -144,7 +144,7 @@ def _nested_objects(
144144
start_path: str,
145145
source: list[str],
146146
):
147-
results = {}
147+
results: dict[str, Patch] = {}
148148
for member, member_data in shape_data.get("members", {}).items():
149149
for p_name, p_data in schema_data.get("properties", {}).items():
150150
if p_name in skip_property_names:
@@ -162,7 +162,10 @@ def _nested_objects(
162162
if "$ref" not in p_data:
163163
break
164164
path = p_data["$ref"][1:]
165-
p_data = resolver.resolve_from_url(p_data["$ref"])
165+
try:
166+
p_data = resolver.resolve_from_url(p_data["$ref"])
167+
except RefResolutionError:
168+
return results
166169

167170
# skip if we already have an enum or pattern
168171
if any([p_data.get(field) for field in _fields]):

scripts/boto/update_schemas_from_boto.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
"batch",
2929
]
3030

31+
exceptions = {
32+
"ses": ["/definitions/EventDestination/properties/MatchingEventTypes/items"]
33+
}
34+
3135

3236
def configure_logging():
3337
"""Setup Logging"""
@@ -88,6 +92,9 @@ def build_resource_type_patches(
8892
)
8993
continue
9094
if value:
95+
if patch.source[0] in exceptions:
96+
if path in exceptions[patch.source[0]]:
97+
continue
9198
if patch.source[0] in case_insensitive_services and field == "enum":
9299
field = "enumCaseInsensitive"
93100
value = [v.lower() for v in value]

src/cfnlint/data/schemas/patches/extensions/all/aws_ses_configurationseteventdestination/boto.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
[
2-
{
3-
"op": "add",
4-
"path": "/definitions/EventDestination/properties/MatchingEventTypes/items/enum",
5-
"value": [
6-
"bounce",
7-
"click",
8-
"complaint",
9-
"delivery",
10-
"open",
11-
"reject",
12-
"renderingFailure",
13-
"send"
14-
]
15-
},
162
{
173
"op": "add",
184
"path": "/definitions/DimensionConfiguration/properties/DimensionValueSource/enum",

src/cfnlint/data/schemas/providers/us_east_1/aws-ses-configurationseteventdestination.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,6 @@
8282
"MatchingEventTypes": {
8383
"insertionOrder": false,
8484
"items": {
85-
"enum": [
86-
"bounce",
87-
"click",
88-
"complaint",
89-
"delivery",
90-
"open",
91-
"reject",
92-
"renderingFailure",
93-
"send"
94-
],
9585
"type": "string"
9686
},
9787
"type": "array",

0 commit comments

Comments
 (0)