From d9cc2a09d02782362ce1f62e0f741ffee4ffb782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TATSUNO=20=E2=80=9CTaz=E2=80=9D=20Yasuhiro?= Date: Fri, 11 Sep 2026 12:50:55 +0900 Subject: [PATCH] fix(rds): map Aurora MySQL engine versions to the MySQL image tag (#3382) CreateDBCluster with Engine aurora-mysql and an Aurora version such as 8.0.mysql_aurora.3.08.0 used the version literally as the container image tag. Docker has no such tag, leading the pull to 404. Take the MySQL version in front of the Aurora suffix, so that example runs mysql:8.0. Plain mysql versions still map to their own tag. The Go compatibility tests for the RDS Data API on aurora-mysql skip when the cluster cannot be created, so this failure never showed in CI. They now run with the mapping fixed. --- docs/services/rds.md | 1 + .../hectorvent/floci/services/rds/RdsService.java | 5 +++++ .../floci/services/rds/RdsServiceTest.java | 12 ++++++++++++ 3 files changed, 18 insertions(+) diff --git a/docs/services/rds.md b/docs/services/rds.md index 3dadd52e58..fe4111ddb5 100644 --- a/docs/services/rds.md +++ b/docs/services/rds.md @@ -236,6 +236,7 @@ mysql -h 127.0.0.1 -P 7002 -u root -psecret123 | `mariadb` | `mariadb:11` | Override the image per-instance with the `--engine-version` flag or globally via environment variables. +Aurora MySQL versions such as `8.0.mysql_aurora.3.08.0` use the MySQL version in front, so that example runs `mysql:8.0`. ## Option Groups diff --git a/src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java b/src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java index f08aa0bca9..81be337b8d 100644 --- a/src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java +++ b/src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java @@ -3791,6 +3791,11 @@ public class RdsService implements Resettable, ResourceProvider { } String requestedTag = engineVersion.trim(); + // Aurora MySQL versions read 8.0.mysql_aurora.3.08.0. The MySQL image tag is the part in front. + var auroraSuffix = requestedTag.indexOf(".mysql_aurora."); + if (auroraSuffix > 0) { + requestedTag = requestedTag.substring(0, auroraSuffix); + } if (!SAFE_IMAGE_TAG_PATTERN.matcher(requestedTag).matches()) { throw new AwsException("InvalidParameterValue", "Unsupported engine version tag: " + engineVersion, 400); diff --git a/src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java b/src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java index c3f31a8608..ab32d820c6 100644 --- a/src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java @@ -211,6 +211,18 @@ class RdsServiceTest { RdsService.imageForRequestedVersion("postgres:16-alpine", "18.1-alpine")); } + @Test + void auroraMysqlImageUsesTheMysqlVersionInFrontOfTheAuroraSuffix() { + assertEquals("mysql:8.0", + RdsService.imageForRequestedVersion("mysql:8.0", "8.0.mysql_aurora.3.08.0")); + assertEquals("mysql:5.7", + RdsService.imageForRequestedVersion("mysql:8.0", "5.7.mysql_aurora.2.12.5")); + assertEquals("mysql:8.4", + RdsService.imageForRequestedVersion("mysql:8.0", "8.4.mysql_aurora.3.10.0")); + assertEquals("mysql:8.0.36", + RdsService.imageForRequestedVersion("mysql:8.0", "8.0.36")); + } + @Test void createDbClusterRejectsADuplicateIdentifier() { rdsService.createDbCluster("dup-cluster", "postgres", "17.5",