fix(ec2): add t2.medium through t2.2xlarge to the instance type catalog (#5528)

DescribeInstanceTypes returned an empty result for t2.medium and t2.large,
so the aws_ec2_instance_type data source failed with 'empty result'.
Add t2.medium, t2.large, t2.xlarge and t2.2xlarge with AWS-documented
vCPU, memory, ENI and IPv4-per-interface limits.
This commit is contained in:
Allen Sanborn authored and GitHub committed 2026-10-13 08:26:03 -04:00
1 parent e919560e3c
commit 24c1fdcef7
2 files changed
+75

No files matched your search

@@ -38,6 +38,58 @@ instanceTypes:
- networkCardIndex: 0
maximumNetworkInterfaces: 3
- instanceType: t2.medium
vcpu: 2
memoryMib: 4096
supportedArchitectures:
- x86_64
currentGeneration: true
encryptionInTransitSupported: false
defaultNetworkCardIndex: 0
ipv4AddressesPerInterface: 6
networkCards:
- networkCardIndex: 0
maximumNetworkInterfaces: 3
- instanceType: t2.large
vcpu: 2
memoryMib: 8192
supportedArchitectures:
- x86_64
currentGeneration: true
encryptionInTransitSupported: false
defaultNetworkCardIndex: 0
ipv4AddressesPerInterface: 12
networkCards:
- networkCardIndex: 0
maximumNetworkInterfaces: 3
- instanceType: t2.xlarge
vcpu: 4
memoryMib: 16384
supportedArchitectures:
- x86_64
currentGeneration: true
encryptionInTransitSupported: false
defaultNetworkCardIndex: 0
ipv4AddressesPerInterface: 15
networkCards:
- networkCardIndex: 0
maximumNetworkInterfaces: 3
- instanceType: t2.2xlarge
vcpu: 8
memoryMib: 32768
supportedArchitectures:
- x86_64
currentGeneration: true
encryptionInTransitSupported: false
defaultNetworkCardIndex: 0
ipv4AddressesPerInterface: 15
networkCards:
- networkCardIndex: 0
maximumNetworkInterfaces: 3
- instanceType: t3.nano
vcpu: 2
memoryMib: 512
@@ -31,6 +31,10 @@ class Ec2InstanceTypeCatalogTest {
"t2.nano",
"t2.micro",
"t2.small",
"t2.medium",
"t2.large",
"t2.xlarge",
"t2.2xlarge",
"t3.nano",
"t3.micro",
"t3.small",
@@ -56,6 +60,14 @@ class Ec2InstanceTypeCatalogTest {
assertLargeGravitonType("m8gd.large");
}
@Test
void largerT2TypesResolveWithDocumentedCapacity() {
assertT2Type("t2.medium", 2, 4096, 6, 3);
assertT2Type("t2.large", 2, 8192, 12, 3);
assertT2Type("t2.xlarge", 4, 16384, 15, 3);
assertT2Type("t2.2xlarge", 8, 32768, 15, 3);
}
@Test
void unknownInstanceTypeIsAbsent() {
assertFalse(instanceTypeCatalog.find("m8gd.xlarge").isPresent());
@@ -144,6 +156,17 @@ class Ec2InstanceTypeCatalogTest {
.toResponseMap().get("burstablePerformanceSupported"));
}
private void assertT2Type(String name, int vcpu, int memoryMib, int ipv4PerInterface, int maxInterfaces) {
Ec2InstanceTypeCatalog.CatalogInstanceType instanceType = instanceTypeCatalog.find(name).orElseThrow();
assertEquals(vcpu, instanceType.vcpu, name);
assertEquals(memoryMib, instanceType.memoryMib, name);
assertEquals(List.of("x86_64"), instanceType.supportedArchitectures, name);
assertEquals(ipv4PerInterface, instanceType.ipv4AddressesPerInterface, name);
assertEquals(maxInterfaces, instanceType.networkCards.get(0).maximumNetworkInterfaces, name);
assertTrue(instanceType.currentGeneration, name);
}
private void assertLargeGravitonType(String name) {
Ec2InstanceTypeCatalog.CatalogInstanceType instanceType = instanceTypeCatalog.find(name).orElseThrow();