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.
This commit is contained in:
TATSUNO “Taz” Yasuhiro authored and GitHub committed 2026-09-10 23:50:55 -04:00
1 parent 22bae1fcd2
commit d9cc2a09d0
3 files changed
+18

No files matched your search

+1
View File
@@ -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
@@ -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);
@@ -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",