Skip to content

armgit / floci

Public Imported from GitHub
0

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

fix(ec2): add t2.nano, t2.small, t3.nano and t3a.nano to the instance type catalog (#4788)

Allen Sanborn3a56aad67057
diff --git a/src/main/resources/ec2/instance-type-catalog.yaml b/src/main/resources/ec2/instance-type-catalog.yaml
index b60185684d..964893a2c2 100644
--- a/src/main/resources/ec2/instance-type-catalog.yaml
+++ b/src/main/resources/ec2/instance-type-catalog.yaml
@@ -1,4 +1,17 @@
instanceTypes:
+ - instanceType: t2.nano
+ vcpu: 1
+ memoryMib: 512
+ supportedArchitectures:
+ - x86_64
+ currentGeneration: true
+ encryptionInTransitSupported: false
+ defaultNetworkCardIndex: 0
+ ipv4AddressesPerInterface: 2
+ networkCards:
+ - networkCardIndex: 0
+ maximumNetworkInterfaces: 2
+
- instanceType: t2.micro
vcpu: 1
memoryMib: 1024
@@ -12,6 +25,32 @@ instanceTypes:
- networkCardIndex: 0
maximumNetworkInterfaces: 2
+ - instanceType: t2.small
+ vcpu: 1
+ memoryMib: 2048
+ supportedArchitectures:
+ - x86_64
+ currentGeneration: true
+ encryptionInTransitSupported: false
+ defaultNetworkCardIndex: 0
+ ipv4AddressesPerInterface: 4
+ networkCards:
+ - networkCardIndex: 0
+ maximumNetworkInterfaces: 3
+
+ - instanceType: t3.nano
+ vcpu: 2
+ memoryMib: 512
+ supportedArchitectures:
+ - x86_64
+ currentGeneration: true
+ encryptionInTransitSupported: false
+ defaultNetworkCardIndex: 0
+ ipv4AddressesPerInterface: 2
+ networkCards:
+ - networkCardIndex: 0
+ maximumNetworkInterfaces: 2
+
- instanceType: t3.micro
vcpu: 2
memoryMib: 1024
@@ -51,6 +90,19 @@ instanceTypes:
- networkCardIndex: 0
maximumNetworkInterfaces: 3
+ - instanceType: t3a.nano
+ vcpu: 2
+ memoryMib: 512
+ supportedArchitectures:
+ - x86_64
+ currentGeneration: true
+ encryptionInTransitSupported: false
+ defaultNetworkCardIndex: 0
+ ipv4AddressesPerInterface: 2
+ networkCards:
+ - networkCardIndex: 0
+ maximumNetworkInterfaces: 2
+
- instanceType: m5.large
vcpu: 2
memoryMib: 8192
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 86c104d590..005f97b098 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
@@ -28,10 +28,14 @@ class Ec2InstanceTypeCatalogTest {
.collect(Collectors.toSet());
assertEquals(Set.of(
+ "t2.nano",
"t2.micro",
+ "t2.small",
+ "t3.nano",
"t3.micro",
"t3.small",
"t3.medium",
+ "t3a.nano",
"m5.large",
"t4g.micro",
"t4g.small",
diff --git a/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2IntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2IntegrationTest.java
index a17a886742..60ad02179f 100644
--- a/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2IntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2IntegrationTest.java
@@ -965,6 +965,53 @@ class Ec2IntegrationTest {
everyItem(equalTo("us-east-1")));
}
+ @Test
+ @Order(22)
+ void describeNanoInstanceTypeOfferingsInEveryAvailabilityZone() {
+ // terratest's GetRecommendedInstanceType picks the first type offered in every AZ.
+ given()
+ .formParam("Action", "DescribeInstanceTypeOfferings")
+ .formParam("LocationType", "availability-zone")
+ .formParam("Filter.1.Name", "instance-type")
+ .formParam("Filter.1.Value.1", "t2.nano")
+ .formParam("Filter.1.Value.2", "t3.nano")
+ .header("Authorization", AUTH_HEADER)
+ .when()
+ .post("/")
+ .then()
+ .statusCode(200)
+ .contentType("application/xml")
+ .body("DescribeInstanceTypeOfferingsResponse.instanceTypeOfferingSet.item.size()", equalTo(6))
+ .body("DescribeInstanceTypeOfferingsResponse.instanceTypeOfferingSet.item.findAll { it.instanceType == 't2.nano' }.location",
+ containsInAnyOrder("us-east-1a", "us-east-1b", "us-east-1c"))
+ .body("DescribeInstanceTypeOfferingsResponse.instanceTypeOfferingSet.item.findAll { it.instanceType == 't3.nano' }.location",
+ containsInAnyOrder("us-east-1a", "us-east-1b", "us-east-1c"));
+ }
+
+ @Test
+ @Order(22)
+ void describeSmallBurstableInstanceTypes() {
+ given()
+ .formParam("Action", "DescribeInstanceTypes")
+ .formParam("InstanceType.1", "t3a.nano")
+ .formParam("InstanceType.2", "t2.small")
+ .header("Authorization", AUTH_HEADER)
+ .when()
+ .post("/")
+ .then()
+ .statusCode(200)
+ .contentType("application/xml")
+ .body("DescribeInstanceTypesResponse.instanceTypeSet.item.size()", equalTo(2))
+ .body("DescribeInstanceTypesResponse.instanceTypeSet.item.find { it.instanceType == 't3a.nano' }.vCpuInfo.defaultVCpus",
+ equalTo("2"))
+ .body("DescribeInstanceTypesResponse.instanceTypeSet.item.find { it.instanceType == 't3a.nano' }.memoryInfo.sizeInMiB",
+ equalTo("512"))
+ .body("DescribeInstanceTypesResponse.instanceTypeSet.item.find { it.instanceType == 't2.small' }.vCpuInfo.defaultVCpus",
+ equalTo("1"))
+ .body("DescribeInstanceTypesResponse.instanceTypeSet.item.find { it.instanceType == 't2.small' }.memoryInfo.sizeInMiB",
+ equalTo("2048"));
+ }
+
// =========================================================================
// VPCs
// =========================================================================