Skip to content

Commit

Permalink
Allow 5.7/8.0 for DB Engine Version (#3796)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong authored Oct 28, 2024
1 parent f17aa12 commit 9d68e60
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
27 changes: 19 additions & 8 deletions scripts/update_schemas_from_aws_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ def write_db_cluster(results):
for engine in engines:
if not results.get(engine):
continue

engine_versions = sorted(results.get(engine))
if engine == "aurora-mysql":
for engine_version in engine_versions.copy():
sub_engine_version = ".".join(engine_version.split(".")[0:2])
if sub_engine_version not in engine_versions:
engine_versions.append(sub_engine_version)
engine_versions = sorted(engine_versions)

schema["allOf"].append(
{
"if": {
Expand All @@ -85,11 +94,7 @@ def write_db_cluster(results):
},
"required": ["Engine", "EngineVersion"],
},
"then": {
"properties": {
"EngineVersion": {"enum": sorted(results.get(engine))}
}
},
"then": {"properties": {"EngineVersion": {"enum": engine_versions}}},
}
)

Expand Down Expand Up @@ -145,6 +150,14 @@ def write_db_instance(results):
for engine in engines:
if not results.get(engine):
continue

engine_versions = sorted(results.get(engine))
if engine == "aurora-mysql":
for engine_version in engine_versions.copy():
sub_engine_version = ".".join(engine_version.split(".")[0:2])
if sub_engine_version not in engine_versions:
engine_versions.append(sub_engine_version)
engine_versions = sorted(engine_versions)
schema["allOf"].append(
{
"if": {
Expand All @@ -159,9 +172,7 @@ def write_db_instance(results):
"required": ["Engine", "EngineVersion"],
},
"then": {
"properties": {
"EngineVersion": {"enum": sorted(results.get(engine))}
}
"properties": {"EngineVersion": {"enum": sorted(engine_versions)}}
},
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"properties": {
"EngineVersion": {
"enum": [
"5.7",
"5.7.mysql_aurora.2.11.1",
"5.7.mysql_aurora.2.11.2",
"5.7.mysql_aurora.2.11.3",
Expand All @@ -61,6 +62,7 @@
"5.7.mysql_aurora.2.12.2",
"5.7.mysql_aurora.2.12.3",
"5.7.mysql_aurora.2.12.4",
"8.0",
"8.0.mysql_aurora.3.04.0",
"8.0.mysql_aurora.3.04.1",
"8.0.mysql_aurora.3.04.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"properties": {
"EngineVersion": {
"enum": [
"5.7",
"5.7.mysql_aurora.2.11.1",
"5.7.mysql_aurora.2.11.2",
"5.7.mysql_aurora.2.11.3",
Expand All @@ -77,6 +78,7 @@
"5.7.mysql_aurora.2.12.2",
"5.7.mysql_aurora.2.12.3",
"5.7.mysql_aurora.2.12.4",
"8.0",
"8.0.mysql_aurora.3.04.0",
"8.0.mysql_aurora.3.04.1",
"8.0.mysql_aurora.3.04.2",
Expand Down

0 comments on commit 9d68e60

Please sign in to comment.