Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

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

Allen Sanborn24c1fdcef7b7
diff --git a/src/main/resources/ec2/instance-type-catalog.yaml b/src/main/resources/ec2/instance-type-catalog.yaml
index 964893a2c2..bab17aa7e7 100644
--- a/src/main/resources/ec2/instance-type-catalog.yaml
+++ b/src/main/resources/ec2/instance-type-catalog.yaml
@@ -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
diff --git a/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2InstanceTypeCatalogTest.java b/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2InstanceTypeCatalogTest.java
index 5cedcf5a83..da02b130c8 100644
--- a/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2InstanceTypeCatalogTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2InstanceTypeCatalogTest.java
@@ -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();