From 9d68e60696f8e241f595219f7c3dd3688d1a1a3e Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Mon, 28 Oct 2024 12:36:03 -0700 Subject: [PATCH] Allow 5.7/8.0 for DB Engine Version (#3796) --- scripts/update_schemas_from_aws_api.py | 27 +++++++++++++------ .../aws_rds_dbcluster/engine_version.json | 2 ++ .../aws_rds_dbinstance/engine_version.json | 2 ++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/scripts/update_schemas_from_aws_api.py b/scripts/update_schemas_from_aws_api.py index 858448b674..c51f654a68 100755 --- a/scripts/update_schemas_from_aws_api.py +++ b/scripts/update_schemas_from_aws_api.py @@ -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": { @@ -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}}}, } ) @@ -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": { @@ -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)}} }, } ) diff --git a/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/engine_version.json b/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/engine_version.json index 7ff310ed56..12fdb455a6 100644 --- a/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/engine_version.json +++ b/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/engine_version.json @@ -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", @@ -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", diff --git a/src/cfnlint/data/schemas/extensions/aws_rds_dbinstance/engine_version.json b/src/cfnlint/data/schemas/extensions/aws_rds_dbinstance/engine_version.json index 23546aafd6..84891f5fbe 100644 --- a/src/cfnlint/data/schemas/extensions/aws_rds_dbinstance/engine_version.json +++ b/src/cfnlint/data/schemas/extensions/aws_rds_dbinstance/engine_version.json @@ -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", @@ -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",