fix(ec2): offer i4i.large in the instance type catalog (#7824)

This commit is contained in:
Jackson Price authored and GitHub committed 2026-11-09 13:13:00 -04:00
1 parent 068740794a
commit 3700a6b6fa
5 files changed
+112 -3

No files matched your search

+14 -3
View File
@@ -33,12 +33,23 @@ EBS-only storage, and one network card supporting 3 interfaces and 10 IPv4 addre
interface, following the [AWS R5 specifications](https://docs.aws.amazon.com/ec2/latest/instancetypes/mo.html).
`DescribeInstanceTypes` and `DescribeInstanceTypeOfferings` use this same entry.
The catalog also includes `i4i.large`: 2 vCPUs, 16 GiB of memory, Intel x86_64
processors, 468 GB of local NVMe SSD storage, and one network card supporting
3 interfaces and 10 IPv4 addresses per interface, following the
[AWS storage optimized specifications](https://docs.aws.amazon.com/ec2/latest/instancetypes/so.html).
Both describe APIs and the existing container resource limits use this entry.
### Processor manufacturer metadata
`DescribeInstanceTypes` includes `ProcessorInfo.Manufacturer` for the bundled
instance types. The values were captured from AWS in `us-east-1` on 2026-11-04:
`AWS` for Graviton, `Intel` for the catalog's T2, T3, M5 and R5 types, and `AMD`
for `t3a.nano`. The catalog stores these values explicitly; architecture alone
instance types. For Graviton, T2, T3, M5, R5 and `t3a.nano`, the values were
captured from AWS in `us-east-1` on 2026-11-04: `AWS` for Graviton, `Intel` for
T2, T3, M5 and R5, and `AMD` for `t3a.nano`.
The `i4i.large` value, `Intel`, comes from the AWS storage optimized specifications
linked above. It was not part of that API capture.
The catalog stores these values explicitly; architecture alone
cannot distinguish Intel from AMD. See the AWS
[ProcessorInfo API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ProcessorInfo.html).
@@ -199,6 +199,22 @@ instanceTypes:
- networkCardIndex: 0
maximumNetworkInterfaces: 3
# Storage optimized: one 468 GB AWS Nitro SSD.
- instanceType: i4i.large
processorManufacturer: Intel
vcpu: 2
memoryMib: 16384
localStorageGiB: 468
supportedArchitectures:
- x86_64
currentGeneration: true
encryptionInTransitSupported: true
defaultNetworkCardIndex: 0
ipv4AddressesPerInterface: 10
networkCards:
- networkCardIndex: 0
maximumNetworkInterfaces: 3
- instanceType: t4g.micro
processorManufacturer: AWS
vcpu: 2
@@ -0,0 +1,65 @@
package io.floci.aws.services.ec2;
import io.floci.aws.testing.AwsTestClients;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.ec2.Ec2Client;
import software.amazon.awssdk.services.ec2.model.InstanceType;
import software.amazon.awssdk.services.ec2.model.InstanceTypeInfo;
import software.amazon.awssdk.services.ec2.model.InstanceTypeOffering;
import software.amazon.awssdk.services.ec2.model.LocationType;
import software.amazon.awssdk.services.ec2.model.NetworkCardInfo;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.hasSize;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@QuarkusTest
class Ec2I4iCatalogIntegrationTest {
@Test
void i4iLargeMetadataAndAvailabilityZoneOfferingsAgree() {
try (Ec2Client ec2 = AwsTestClients.create(Ec2Client.builder(), "test", Region.US_EAST_1)) {
List<InstanceTypeInfo> types = ec2.describeInstanceTypes(r -> r.instanceTypes(InstanceType.I4_I_LARGE))
.instanceTypes();
assertThat(types, hasSize(1));
InstanceTypeInfo type = types.getFirst();
assertEquals(InstanceType.I4_I_LARGE, type.instanceType());
assertEquals(2, type.vCpuInfo().defaultVCpus());
assertEquals(16384L, type.memoryInfo().sizeInMiB());
assertEquals("Intel", type.processorInfo().manufacturer());
assertThat(type.processorInfo().supportedArchitecturesAsStrings(), contains("x86_64"));
assertTrue(type.instanceStorageSupported());
assertEquals(468L, type.instanceStorageInfo().totalSizeInGB());
assertFalse(type.burstablePerformanceSupported());
assertThat(type.supportedUsageClassesAsStrings(), containsInAnyOrder("on-demand", "spot"));
assertTrue(type.networkInfo().encryptionInTransitSupported());
assertEquals(0, type.networkInfo().defaultNetworkCardIndex());
assertEquals(10, type.networkInfo().ipv4AddressesPerInterface());
assertThat(type.networkInfo().networkCards(), hasSize(1));
NetworkCardInfo card = type.networkInfo().networkCards().getFirst();
assertEquals(0, card.networkCardIndex());
assertEquals(3, card.maximumNetworkInterfaces());
String zone = ec2.describeAvailabilityZones().availabilityZones().getFirst().zoneName();
List<InstanceTypeOffering> offerings = ec2.describeInstanceTypeOfferings(r -> r
.locationType(LocationType.AVAILABILITY_ZONE)
.filters(
f -> f.name("instance-type").values("i4i.large"),
f -> f.name("location").values(zone)))
.instanceTypeOfferings();
assertThat(offerings, hasSize(1));
InstanceTypeOffering offering = offerings.getFirst();
assertEquals(InstanceType.I4_I_LARGE, offering.instanceType());
assertEquals(LocationType.AVAILABILITY_ZONE, offering.locationType());
assertEquals(zone, offering.location());
}
}
}
@@ -43,6 +43,7 @@ class Ec2InstanceTypeCatalogTest {
"t3a.nano",
"m5.large",
"r5.large",
"i4i.large",
"t4g.micro",
"t4g.small",
"t4g.medium",
@@ -63,6 +64,21 @@ class Ec2InstanceTypeCatalogTest {
assertEquals(expected, instanceTypes);
}
@Test
void storageOptimizedI4iLargeHasItsDocumentedCapacity() {
Ec2InstanceTypeCatalog.CatalogInstanceType i4iLarge = instanceTypeCatalog.find("i4i.large").orElseThrow();
assertEquals(2, i4iLarge.vcpu);
assertEquals(16384, i4iLarge.memoryMib);
assertEquals(468, i4iLarge.localStorageGiB);
assertEquals(List.of("x86_64"), i4iLarge.supportedArchitectures);
assertEquals("Intel", i4iLarge.processorManufacturer);
assertTrue(i4iLarge.encryptionInTransitSupported);
assertEquals(10, i4iLarge.ipv4AddressesPerInterface);
assertEquals(3, i4iLarge.networkCards.get(0).maximumNetworkInterfaces);
assertTrue(Boolean.TRUE.equals(i4iLarge.toResponseMap().get("instanceStorageSupported")),
"i4i.large must report instance storage support");
}
@Test
void largeGravitonTypesHaveExactMetadata() {
assertLargeGravitonType("m6gd.large");
@@ -35,6 +35,7 @@ c8g.8xlarge,AWS
c8g.large,AWS
c8g.medium,AWS
c8g.xlarge,AWS
i4i.large,Intel
m5.large,Intel
m6g.12xlarge,AWS
m6g.16xlarge,AWS
1 instanceType,manufacturer
35 c8g.large,AWS
36 c8g.medium,AWS
37 c8g.xlarge,AWS
38 i4i.large,Intel
39 m5.large,Intel
40 m6g.12xlarge,AWS
41 m6g.16xlarge,AWS