fix(rds): list Aurora engines in DescribeOrderableDBInstanceOptions (#5585)

* fix(rds): list Aurora engines in DescribeOrderableDBInstanceOptions

DescribeOrderableDBInstanceOptions returned nothing for aurora-mysql or
aurora-postgresql, so clients that pick an instance class from the
orderable list could not create Aurora cluster instances. Add the
default Aurora MySQL (8.0.mysql_aurora.3.05.2) and Aurora PostgreSQL
(16.3) versions with db.t3.medium, db.t4g.medium, db.r5.large and
db.r6g.large.

* fix(ec2): honour block-device-mapping.volume-type in DescribeImages

The filter fell through to the default case and matched every image.
Registered images now match on any block device mapping's EBS volume
type, mirroring block-device-mapping.snapshot-id. Catalog images model
no block devices, so an optional rootVolumeType catalog field carries
the type where the AMI name states it (gp2 for the Amazon Linux 2
image, gp3 for the hvm-ssd-gp3 Ubuntu images); images without it match
no value. DescribeImages output is unchanged.

* fix(rds): report general-public-license for aurora-mysql orderable options

* fix(ec2): carry catalog root volume type into the image's EBS mapping

* fix(ec2,rds): address review on catalog AMI mappings and Aurora default version

- Catalog AMI root mappings no longer advertise an invented SnapshotId that
  DescribeSnapshots cannot resolve (EbsBlockDevice.SnapshotId is optional);
  a copy or capture still mints a real root snapshot.
- RunInstances sizes the root volume type from the AMI's root mapping,
  falling back to gp3, so the gp2 catalog AMI launches a gp2 root.
- aurora-mysql defaults to 8.0.mysql_aurora.3.05.2, the version
  DescribeOrderableDBInstanceOptions lists.

* test(ec2): assert the volume-type filter, not a single gp2 volume

Instances launched earlier in the class now get gp2 roots from the gp2
catalog AMI, so filtering on gp2 returns several volumes. Check every
result is gp2 and the created volume is among them.

* test(rds): read EngineVersion with XmlPath, import RequestSpecification

* fix(ec2): honour a RunInstances root BlockDeviceMapping volume type

A request BlockDeviceMapping naming the AMI's root device overrides the
AMI's root VolumeType, as on AWS; previously the launch always took the
AMI mapping, so a gp3 root on the gp2 Amazon Linux 2 AMI came out gp2.

* test: explicit RequestSpecification type in Ec2IntegrationTest (NoVar checkstyle rule)

* refactor(ec2): fold RunInstances BlockDeviceMappings into the placement overload

Adds the mappings parameter to the existing hostId/tenancy overload
instead of a new one, and updates the two callers that named that
signature: Ec2RunInstancesPublicIpParamTest's stub/verify (whose
unmatched stub returned null and NPE'd the handler) and the
dedicated-host race test.

* fix(ec2): apply launch template block device mappings and capture the real root type

RunInstances and CreateFleet now layer the request's BlockDeviceMappings
over the launch template's (a request entry for a device replaces the
template's), so a template asking for a gp3 root is honoured instead of
the AMI's gp2. CreateImage records the instance's actual root volume type
on the new AMI's root mapping rather than the source AMI's.

A mapping naming a VolumeType outside the model's enum (standard, io1,
io2, gp2, sc1, st1, gp3) is rejected with the same InvalidParameterValue
ModifyVolume returns, through one shared check.

The RunInstances-only parser is gone: request mappings are read by the
launch template parser, which already treats every member as optional.

* test(rds): fold the Aurora default-version orderable check into RdsCatalogueReadIntegrationTest

* fix(autoscaling): launch group instances with the template's block device mappings

Auto Scaling scale-out now hands the launch template's BlockDeviceMappings
to runInstances, as RunInstances and CreateFleet do, so a group launched
from a template that asks for a gp3 root gets a gp3 root instead of the
AMI's type. Mixed-instances templates take the same path; launch
configurations pass none.

* test(ec2): template devices the request does not name still apply

Covers a launch whose request maps only a data device: the template's
root mapping still sets the root volume type. Also covers a template
naming an unknown VolumeType, which CreateLaunchTemplate stores and the
launch rejects; the EC2 docs paragraph now says so and is rewrapped to
the file's width.

* fix(ec2): merge launch template block device mappings field by field

EC2 documents template block device overrides per member: a request entry
for a DeviceName the template maps changes only what it sets, and every
other member keeps the template's value. The merge replaced the whole
entry, so a request that only resized the root dropped a template's gp3.
The merged entry is now built from a copy of the template's, overlaid
member by member, leaving the stored template untouched.
This commit is contained in:
Allen Sanborn authored and GitHub committed 2026-10-14 15:02:53 -04:00
1 parent 804335d071
commit 025af9d215
21 files changed
+632 -45

No files matched your search

@@ -11,6 +11,7 @@ import io.github.hectorvent.floci.services.ec2.Ec2Service;
import io.github.hectorvent.floci.services.ec2.Ec2UserDataDecoder;
import io.github.hectorvent.floci.services.ec2.model.Instance;
import io.github.hectorvent.floci.services.ec2.model.LaunchTemplate;
import io.github.hectorvent.floci.services.ec2.model.LaunchTemplateData;
import io.github.hectorvent.floci.services.ec2.model.Reservation;
import io.github.hectorvent.floci.services.ec2.model.Subnet;
import io.github.hectorvent.floci.services.elb.ElbClassicService;
@@ -375,7 +376,8 @@ public class AutoScalingReconciler {
launchSource.iamInstanceProfile(),
launchSource.associatePublicIpAddress(), null, 0, null, null, null,
launchSource.encodedUserData() != null ? launchSource.encodedUserData()
: encodeLegacyUserData(launchSource.userData()));
: encodeLegacyUserData(launchSource.userData()),
false, null, null, launchSource.blockDeviceMappings());
for (Instance ec2Inst : reservation.getInstances()) {
AsgInstance asgInst = new AsgInstance();
@@ -695,7 +697,8 @@ public class AutoScalingReconciler {
// Forwarded as-is: an explicit false has to beat a public
// subnet's MapPublicIpOnLaunch, and only null means
// "fall back to the subnet default".
lc.getAssociatePublicIpAddress());
lc.getAssociatePublicIpAddress(),
null);
}
LaunchTemplate launchTemplate = resolveLaunchTemplate(asg);
@@ -723,7 +726,8 @@ public class AutoScalingReconciler {
asg.getLaunchTemplateId(),
asg.getLaunchTemplateName(),
resolvedVersion,
null);
null,
version.getData().getBlockDeviceMappings());
}
MixedInstancesPolicy.LaunchTemplateSpecification specification =
@@ -757,7 +761,8 @@ public class AutoScalingReconciler {
: specification.getLaunchTemplateId(),
specification.getLaunchTemplateName(),
resolvedVersion,
null);
null,
version.getData().getBlockDeviceMappings());
}
}
@@ -868,7 +873,8 @@ public class AutoScalingReconciler {
String launchTemplateId,
String launchTemplateName,
String launchTemplateVersion,
Boolean associatePublicIpAddress) {}
Boolean associatePublicIpAddress,
List<LaunchTemplateData.BlockDeviceMapping> blockDeviceMappings) {}
// Override for describeAutoScalingGroups with null region (all regions)
// The service only filters by region when non-null; null means all.
@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.github.hectorvent.floci.config.EmulatorConfig;
import io.github.hectorvent.floci.services.ec2.model.BlockDeviceMapping;
import io.github.hectorvent.floci.services.ec2.model.EbsBlockDevice;
import io.github.hectorvent.floci.services.ec2.model.Image;
import io.github.hectorvent.floci.services.eks.EksClusterManager;
import io.quarkus.runtime.annotations.RegisterForReflection;
@@ -203,6 +205,8 @@ public class Ec2ImageCatalog {
public String architecture;
public String rootDeviceType;
public String rootDeviceName;
/** Root EBS volume type, set only where the AMI name states it; answers block-device-mapping.volume-type. */
public String rootVolumeType;
public String virtualizationType;
public String hypervisor;
public String platform;
@@ -330,6 +334,20 @@ public class Ec2ImageCatalog {
image.setImageOwnerAlias(imageOwnerAlias);
}
image.setCreationDate(creationDate);
if (rootVolumeType != null) {
// Same value the volume-type filter matches on, so the returned image shows
// the mapping it was selected by and a CopyImage keeps that type.
EbsBlockDevice ebs = new EbsBlockDevice();
// No SnapshotId: it is optional in EbsBlockDevice, and an invented one would not
// resolve through DescribeSnapshots.
ebs.setVolumeSize(8);
ebs.setVolumeType(rootVolumeType);
ebs.setDeleteOnTermination(true);
BlockDeviceMapping mapping = new BlockDeviceMapping();
mapping.setDeviceName(image.getRootDeviceName());
mapping.setEbs(ebs);
image.setBlockDeviceMappings(List.of(mapping));
}
return image;
}
}
@@ -793,9 +793,14 @@ public class Ec2QueryHandler {
LaunchTemplateData.MetadataOptions metadataOptions = parseMetadataOptions(p, "MetadataOptions.");
String creditSpecificationCpuCredits = p.getFirst("CreditSpecification.CpuCredits");
List<LaunchTemplateData.BlockDeviceMapping> blockDeviceMappings =
parseLaunchTemplateBlockDeviceMappings(p, "");
LaunchTemplateData launchTemplateData = resolveRunInstancesLaunchTemplateData(
p, region, userDataEncoded == null || userDataEncoded.isBlank());
if (launchTemplateData != null) {
blockDeviceMappings = LaunchTemplateData.BlockDeviceMapping.merge(
launchTemplateData.getBlockDeviceMappings(), blockDeviceMappings);
if (launchTemplateData.getMetadataOptions() != null) {
metadataOptions = LaunchTemplateData.MetadataOptions.merge(
launchTemplateData.getMetadataOptions(), metadataOptions);
@@ -829,7 +834,7 @@ public class Ec2QueryHandler {
keyName, sgIds, subnetId, clientToken, instanceTags, userData, iamInstanceProfileArn,
associatePublicIp, networkInterfaceId, networkInterfaceDeviceIndex, null, metadataOptions,
creditSpecificationCpuCredits, userDataEncoded, Boolean.parseBoolean(p.getFirst("DryRun")),
p.getFirst("Placement.HostId"), p.getFirst("Placement.Tenancy"));
p.getFirst("Placement.HostId"), p.getFirst("Placement.Tenancy"), blockDeviceMappings);
if (!networkInterfaceTags.isEmpty()) {
List<String> eniIds = new ArrayList<>();
@@ -953,7 +958,8 @@ public class Ec2QueryHandler {
null,
null,
0,
launch.availabilityZone(), null, null, launch.encodedUserData());
launch.availabilityZone(), null, null, launch.encodedUserData(), false,
null, null, launch.blockDeviceMappings());
Instance instance = reservation.getInstances().get(0);
launchedInstanceIds.add(instance.getInstanceId());
results.add(new FleetLaunchResult(instance, launch));
@@ -1111,7 +1117,8 @@ public class Ec2QueryHandler {
template.getEncodedUserData(),
service.iamInstanceProfileArn(template),
template.effectiveSecurityGroupIds(),
new ArrayList<>(tags.values()));
new ArrayList<>(tags.values()),
template.getBlockDeviceMappings());
}
/**
@@ -1156,7 +1163,8 @@ public class Ec2QueryHandler {
private record FleetLaunch(String launchTemplateId, String launchTemplateName, String launchTemplateVersion,
String instanceType, String imageId, String subnetId, String availabilityZone,
String keyName, String userData, String encodedUserData, String iamInstanceProfileArn,
List<String> securityGroupIds, List<Tag> instanceTags) {}
List<String> securityGroupIds, List<Tag> instanceTags,
List<LaunchTemplateData.BlockDeviceMapping> blockDeviceMappings) {}
private record FleetLaunchKey(String launchTemplateId, String launchTemplateName, String launchTemplateVersion,
String instanceType, String imageId, String subnetId, String availabilityZone) {
@@ -5706,7 +5714,8 @@ public class Ec2QueryHandler {
MultivaluedMap<String, String> p, String prefix) {
List<LaunchTemplateData.BlockDeviceMapping> mappings = new ArrayList<>();
for (int i = 1; ; i++) {
String base = prefix + ".BlockDeviceMapping." + i;
// An empty prefix reads RunInstances' own top-level BlockDeviceMapping.N members.
String base = (prefix.isEmpty() ? "" : prefix + ".") + "BlockDeviceMapping." + i;
if (!anyParamStartsWith(p, base + ".")) {
break;
}
@@ -3241,13 +3241,16 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
return runInstances(region, imageId, instanceType, minCount, maxCount, keyName,
securityGroupIds, subnetId, clientToken, instanceTags, userData, iamInstanceProfileArn,
associatePublicIp, networkInterfaceId, networkInterfaceDeviceIndex, availabilityZone,
metadataOptions, creditSpecificationCpuCredits, encodedUserData, dryRun, null, null);
metadataOptions, creditSpecificationCpuCredits, encodedUserData, dryRun, null, null, null);
}
/**
* @param hostId Placement.HostId: the Dedicated Host to launch onto. It must exist and not be
* released; with no subnet or zone named, the launch lands in the host's zone.
* @param tenancy Placement.Tenancy; defaults to {@code host} when a host is named.
* @param blockDeviceMappings the launch's BlockDeviceMappings (request merged over launch
* template), or null. An entry naming the AMI's root device
* overrides the root volume type, as on AWS.
*/
public Reservation runInstances(String region, String imageId, String instanceType,
int minCount, int maxCount, String keyName,
@@ -3258,7 +3261,8 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
int networkInterfaceDeviceIndex, String availabilityZone,
LaunchTemplateData.MetadataOptions metadataOptions,
String creditSpecificationCpuCredits, String encodedUserData, boolean dryRun,
String hostId, String tenancy) {
String hostId, String tenancy,
List<LaunchTemplateData.BlockDeviceMapping> blockDeviceMappings) {
if (hostId != null && !hostId.isBlank()) {
Host host = getRequiredAvailableHost(region, hostId);
if ((availabilityZone == null || availabilityZone.isBlank())
@@ -3355,6 +3359,12 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
validateArchitectureCompatibility(region, imageId, effectiveInstanceType);
int count = Math.min(maxCount, Math.max(minCount, 1));
String architecture = architectureFor(region, imageId, effectiveInstanceType);
if (blockDeviceMappings != null) {
blockDeviceMappings.stream()
.filter(m -> m.getEbs() != null && m.getEbs().getVolumeType() != null)
.forEach(m -> requireValidVolumeType(m.getEbs().getVolumeType()));
}
String rootVolumeType = rootVolumeTypeFor(findImageForCapture(region, imageId), blockDeviceMappings);
List<Instance> launched = new ArrayList<>();
// Resolving the AMI, building the instances that depend on it and publishing them is one
// step. A DeregisterImage releases the captured layer only when no live instance resolves
@@ -3489,7 +3499,7 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
Volume rootVol = new Volume();
rootVol.setVolumeId(rootVolId);
rootVol.setAvailabilityZone(az);
rootVol.setVolumeType(DEFAULT_ROOT_VOLUME_TYPE);
rootVol.setVolumeType(rootVolumeType);
rootVol.setSize(DEFAULT_ROOT_VOLUME_SIZE_GIB);
rootVol.setState("in-use");
rootVol.setRegion(region);
@@ -6722,6 +6732,16 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
private List<BlockDeviceMapping> captureBlockDeviceMappings(String region, Instance source,
Image sourceImage) {
List<BlockDeviceMapping> mappings = new ArrayList<>(sourceImageMappings(sourceImage));
// The root is captured from the volume the instance actually has, which a launch mapping
// may have given a different type from the source AMI's.
Volume rootVolume = source.getRootVolumeId() == null ? null
: volumes.get(key(region, source.getRootVolumeId())).orElse(null);
if (rootVolume != null && sourceImage != null) {
mappings.stream()
.filter(m -> m.getEbs() != null
&& Objects.equals(m.getDeviceName(), sourceImage.getRootDeviceName()))
.forEach(m -> m.getEbs().setVolumeType(rootVolume.getVolumeType()));
}
Set<String> devices = mappings.stream()
.map(BlockDeviceMapping::getDeviceName)
.filter(Objects::nonNull)
@@ -6766,7 +6786,9 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
}
List<BlockDeviceMapping> declared = sourceImage.getBlockDeviceMappings();
if (declared != null && !declared.isEmpty()) {
return declared.stream().map(this::recapture).toList();
return declared.stream()
.map(m -> recapture(m, Objects.equals(m.getDeviceName(), sourceImage.getRootDeviceName())))
.toList();
}
String rootDeviceName = sourceImage.getRootDeviceName();
if (rootDeviceName == null || rootDeviceName.isBlank()) {
@@ -6788,7 +6810,7 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
* would leave two images sharing one snapshot, so deleting either would appear to take the
* other's backing with it.
*/
private BlockDeviceMapping recapture(BlockDeviceMapping source) {
private BlockDeviceMapping recapture(BlockDeviceMapping source, boolean root) {
BlockDeviceMapping mapping = new BlockDeviceMapping();
mapping.setDeviceName(source.getDeviceName());
EbsBlockDevice sourceEbs = source.getEbs();
@@ -6796,7 +6818,9 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
return mapping;
}
EbsBlockDevice ebs = new EbsBlockDevice();
ebs.setSnapshotId(sourceEbs.getSnapshotId() != null ? "snap-" + randomHex(17) : null);
// A catalog AMI's root mapping carries no SnapshotId (there is no snapshot record behind
// it), but the root of a copy or capture is always a snapshot.
ebs.setSnapshotId(sourceEbs.getSnapshotId() != null || root ? "snap-" + randomHex(17) : null);
ebs.setVolumeSize(sourceEbs.getVolumeSize());
ebs.setVolumeType(sourceEbs.getVolumeType());
ebs.setDeleteOnTermination(sourceEbs.getDeleteOnTermination());
@@ -6805,6 +6829,33 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
return mapping;
}
/**
* The root volume takes the type a request mapping for the AMI's root device names, else the
* type the AMI's root mapping declares, as on AWS.
*/
private static String rootVolumeTypeFor(Image image,
List<LaunchTemplateData.BlockDeviceMapping> requestMappings) {
String rootDeviceName = image != null && image.getRootDeviceName() != null
? image.getRootDeviceName() : new Instance().getRootDeviceName();
if (requestMappings != null) {
for (LaunchTemplateData.BlockDeviceMapping m : requestMappings) {
if (m.getEbs() != null && m.getEbs().getVolumeType() != null
&& Objects.equals(m.getDeviceName(), rootDeviceName)) {
return m.getEbs().getVolumeType();
}
}
}
if (image == null || image.getBlockDeviceMappings() == null) {
return DEFAULT_ROOT_VOLUME_TYPE;
}
return image.getBlockDeviceMappings().stream()
.filter(m -> m.getEbs() != null && m.getEbs().getVolumeType() != null
&& Objects.equals(m.getDeviceName(), image.getRootDeviceName()))
.map(m -> m.getEbs().getVolumeType())
.findFirst()
.orElse(DEFAULT_ROOT_VOLUME_TYPE);
}
/** The image a CreateImage source was launched from, whether catalog-backed or registered. */
private Image findImageForCapture(String region, String imageId) {
if (imageId == null || imageId.isBlank()) {
@@ -7611,6 +7662,7 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
}
return switch (name) {
case "architecture" -> matchesFilterValue(values, image.getArchitecture());
case "block-device-mapping.volume-type" -> matchesFilterValue(values, catalogImage.rootVolumeType);
case "hypervisor" -> matchesFilterValue(values, image.getHypervisor());
case "image-id" -> catalogImage.idsAndAliases().stream().anyMatch(id -> matchesFilterValue(values, id));
case "image-type" -> matchesFilterValue(values, "machine");
@@ -7687,6 +7739,11 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
.filter(Objects::nonNull)
.map(EbsBlockDevice::getSnapshotId)
.anyMatch(snapshotId -> matchesFilterValue(values, snapshotId));
case "block-device-mapping.volume-type" -> image.getBlockDeviceMappings().stream()
.map(BlockDeviceMapping::getEbs)
.filter(Objects::nonNull)
.map(EbsBlockDevice::getVolumeType)
.anyMatch(volumeType -> matchesFilterValue(values, volumeType));
case "description" -> matchesFilterValue(values, image.getDescription());
case "hypervisor" -> matchesFilterValue(values, image.getHypervisor());
case "image-id" -> matchesFilterValue(values, image.getImageId());
@@ -10282,6 +10339,13 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
return false;
}
private static void requireValidVolumeType(String volumeType) {
if (!VALID_VOLUME_TYPES.contains(volumeType)) {
throw new AwsException("InvalidParameterValue",
"Value (" + volumeType + ") for parameter volumeType is invalid. Unknown volume type.", 400);
}
}
public VolumeModification modifyVolume(String region, String volumeId, Integer size,
String volumeType, Integer iops, Integer throughput,
Boolean multiAttachEnabled, boolean dryRun) {
@@ -10302,9 +10366,8 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
}
String targetVolumeType = volumeType != null ? volumeType : volume.getVolumeType();
if (volumeType != null && !VALID_VOLUME_TYPES.contains(volumeType)) {
throw new AwsException("InvalidParameterValue",
"Value (" + volumeType + ") for parameter volumeType is invalid. Unknown volume type.", 400);
if (volumeType != null) {
requireValidVolumeType(volumeType);
}
if (throughput != null && !"gp3".equals(targetVolumeType)) {
@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonSetter;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* The subset of EC2 {@code RequestLaunchTemplateData} / {@code ResponseLaunchTemplateData} that
@@ -387,6 +389,28 @@ public class LaunchTemplateData {
public Ebs getEbs() { return ebs; }
public void setEbs(Ebs ebs) { this.ebs = ebs; }
/**
* A launch's mappings, as EC2 documents template overrides: a request entry for a device the
* template maps changes only the members it sets, and every other device keeps its own
* entry. The template's stored entries are never modified.
*/
public static List<BlockDeviceMapping> merge(List<BlockDeviceMapping> template,
List<BlockDeviceMapping> request) {
Map<String, BlockDeviceMapping> byDevice = new LinkedHashMap<>();
template.forEach(m -> byDevice.put(m.deviceName, m));
request.forEach(m -> byDevice.merge(m.deviceName, m, BlockDeviceMapping::overlaid));
return new ArrayList<>(byDevice.values());
}
private static BlockDeviceMapping overlaid(BlockDeviceMapping base, BlockDeviceMapping override) {
BlockDeviceMapping merged = new BlockDeviceMapping();
merged.deviceName = base.deviceName;
merged.virtualName = override.virtualName != null ? override.virtualName : base.virtualName;
merged.noDevice = override.noDevice != null ? override.noDevice : base.noDevice;
merged.ebs = Ebs.overlaid(base.ebs, override.ebs);
return merged;
}
}
@RegisterForReflection
@@ -424,6 +448,23 @@ public class LaunchTemplateData {
public Integer getThroughput() { return throughput; }
public void setThroughput(Integer throughput) { this.throughput = throughput; }
private static Ebs overlaid(Ebs base, Ebs override) {
if (base == null || override == null) {
return override != null ? override : base;
}
Ebs merged = new Ebs();
merged.encrypted = override.encrypted != null ? override.encrypted : base.encrypted;
merged.deleteOnTermination = override.deleteOnTermination != null
? override.deleteOnTermination : base.deleteOnTermination;
merged.iops = override.iops != null ? override.iops : base.iops;
merged.kmsKeyId = override.kmsKeyId != null ? override.kmsKeyId : base.kmsKeyId;
merged.snapshotId = override.snapshotId != null ? override.snapshotId : base.snapshotId;
merged.volumeSize = override.volumeSize != null ? override.volumeSize : base.volumeSize;
merged.volumeType = override.volumeType != null ? override.volumeType : base.volumeType;
merged.throughput = override.throughput != null ? override.throughput : base.throughput;
return merged;
}
}
@RegisterForReflection
@@ -26,6 +26,8 @@ final class RdsEngineCatalog {
}
private static final List<String> PROVISIONED = List.of("provisioned");
private static final List<String> AURORA_CLASSES =
List.of("db.t3.medium", "db.t4g.medium", "db.r5.large", "db.r6g.large");
static final List<EngineVersion> VERSIONS = List.of(
postgres("13.20", "13", false, List.of()),
@@ -51,11 +53,11 @@ final class RdsEngineCatalog {
new EngineVersion("aurora-postgresql", "15.12", "15", "aurora-postgresql15",
"Aurora (PostgreSQL)", false, List.of(), PROVISIONED),
new EngineVersion("aurora-postgresql", "16.3", "16", "aurora-postgresql16",
"Aurora (PostgreSQL)", true, List.of(), PROVISIONED),
"Aurora (PostgreSQL)", true, AURORA_CLASSES, PROVISIONED),
new EngineVersion("aurora-postgresql", "17.4", "17", "aurora-postgresql17",
"Aurora (PostgreSQL)", false, List.of(), PROVISIONED),
new EngineVersion("aurora-mysql", "8.0.mysql_aurora.3.05.2", "8.0", "aurora-mysql8.0",
"Aurora MySQL", true, List.of(), PROVISIONED),
"Aurora MySQL", true, AURORA_CLASSES, PROVISIONED),
new EngineVersion("aurora-mysql", "8.0.mysql_aurora.3.08.0", "8.0", "aurora-mysql8.0",
"Aurora MySQL", false, List.of(), PROVISIONED));
@@ -912,6 +912,9 @@ public class RdsQueryHandler {
if (engine != null && engine.regionMatches(true, 0, "sqlserver", 0, 9)) {
return "license-included";
}
if (engine != null && engine.equalsIgnoreCase("aurora-mysql")) {
return "general-public-license";
}
return "postgresql-license";
}