Skip to content

fix(rds): allow major-only EngineVersion for mysql and mariadb - #4796

Merged
kddejong merged 1 commit into
aws-cloudformation:mainfrom
moneytool:fix/rds-mysql-major-engine-version
Oct 24, 2026
Merged

kddejong merged 1 commit into
aws-cloudformation:mainfrom
moneytool:fix/rds-mysql-major-engine-version

Conversation

@moneytool

Copy link
Copy Markdown
Contributor

Issue #, if available: Fixes #4774

Description of changes:

  • Root cause: scripts/update_schemas_from_aws_api.py adds shortened engine versions only for postgres (major) and aurora-mysql (major.minor). As a result the mysql and mariadb enums contain only full X.Y.Z versions, and a major-only EngineVersion such as "8.0" (mysql) or "10.11" (mariadb) fails E3691, even though RDS accepts it. AWS::RDS::DBCluster with Engine: mysql has the same problem under E3690.
  • Change: following Allow for major versions for postgres #3850, write_db_instance now derives major.minor values for mysql and mariadb, and write_db_cluster does the same for mysql.
  • Deprecation rules (W3691/W3690): the *_deprecated writers are left unchanged on purpose. Deriving majors there the way aurora-mysql does would mark a major as deprecated as soon as any one of its minors is, so mysql 8.0 would pass E3691 but trip W3691. The trade-off is that a major whose minors are all deprecated (mysql 5.7, mariadb 10.5) now passes E3691 without a W3691 warning. Flagging only those majors would need the deprecated writers to see the available versions too; happy to do that here or in a follow-up if you prefer.
  • Data: I regenerated aws_rds_dbinstance/engine_version.json (+16: 5 mysql, 11 mariadb) and aws_rds_dbcluster/engine_version.json (+5 mysql) by running the script's own writer functions on the versions already in those files, so no AWS API call was made. Before the script change, the same run reproduced both files byte-for-byte.
  • Tests: added tests that run E3691 and E3690 against the shipped schemas. They check that mysql 8.0/8.4 and mariadb 10.11/11.4 pass, that postgres 16 and aurora-mysql 8.0 still pass, and that an invalid 9.99 still fails. The new major-only cases fail without the data change. No snapshot changes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kddejong
kddejong force-pushed the fix/rds-mysql-major-engine-version branch from 52e25e5 to c99c74d Compare October 23, 2026 21:31
E3691 (AWS::RDS::DBInstance) and E3690 (AWS::RDS::DBCluster) flagged
major-only EngineVersion values such as "8.0" for mysql and "10.11" for
mariadb. RDS accepts these and resolves them to a recent minor release.

update_schemas_from_aws_api.py only derived shortened versions for
postgres (major) and aurora-mysql (major.minor). Derive major.minor
values for mysql and mariadb in write_db_instance, and for mysql in
write_db_cluster, the same way aws-cloudformation#3850 did for postgres.

The engine_version.json data files are regenerated by running the
script's writer functions on the versions already present in them, so
no AWS API call was needed. The *_deprecated writers are unchanged.

Fixes aws-cloudformation#4774
@kddejong
kddejong force-pushed the fix/rds-mysql-major-engine-version branch from c99c74d to bf38945 Compare October 23, 2026 23:30
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.68%. Comparing base (a08bf36) to head (bf38945).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4796   +/-   ##
=======================================
  Coverage   94.68%   94.68%           
=======================================
  Files         439      439           
  Lines       16004    16004           
  Branches     3108     3108           
=======================================
  Hits        15153    15153           
  Misses        468      468           
  Partials      383      383           
Flag Coverage Δ
unittests 94.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kddejong
kddejong merged commit 7e272d0 into aws-cloudformation:main Oct 24, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E3691: false positive for major-only EngineVersion on mysql and mariadb

2 participants