From 982c6bea0252689c23628079ab66998ac2a36aa9 Mon Sep 17 00:00:00 2001
From: Vikas Rangarajan <7152444+VRanga000@users.noreply.github.com>
Date: Mon, 30 Jul 2018 15:41:02 -0500
Subject: [PATCH] JCLOUDS-1387: Add support for c5 instance types in AWS ec2
---
.../compute/domain/EC2HardwareBuilder.java | 65 ++++++++++++++++++
.../org/jclouds/ec2/domain/InstanceType.java | 66 +++++++++++++++++++
.../suppliers/AWSEC2HardwareSupplier.java | 14 +++-
3 files changed, 144 insertions(+), 1 deletion(-)
diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java
index b9ca769eb1..fbb730efcf 100644
--- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java
+++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java
@@ -249,6 +249,11 @@ public class EC2HardwareBuilder extends HardwareBuilder {
return this;
}
+ private EC2HardwareBuilder c5() {
+ virtualizationTypes(VirtualizationType.HVM, VirtualizationType.PARAVIRTUAL);
+ return this;
+ }
+
// TODO include D2 (dense) types?
private EC2HardwareBuilder d2() {
virtualizationTypes(VirtualizationType.HVM);
@@ -730,6 +735,66 @@ public class EC2HardwareBuilder extends HardwareBuilder {
.rootDeviceType(RootDeviceType.EBS);
}
+ /**
+ * @see InstanceType#C5_LARGE
+ */
+ public static EC2HardwareBuilder c5_large() {
+ return new EC2HardwareBuilder(InstanceType.C5_LARGE).c5()
+ .ram(4096)
+ .processors(ImmutableList.of(new Processor(2.0, 3.0)))
+ .rootDeviceType(RootDeviceType.EBS);
+ }
+
+ /**
+ * @see InstanceType#C5_XLARGE
+ */
+ public static EC2HardwareBuilder c5_xlarge() {
+ return new EC2HardwareBuilder(InstanceType.C5_XLARGE).c5()
+ .ram(8192)
+ .processors(ImmutableList.of(new Processor(4.0, 3.0)))
+ .rootDeviceType(RootDeviceType.EBS);
+ }
+
+ /**
+ * @see InstanceType#C5_2XLARGE
+ */
+ public static EC2HardwareBuilder c5_2xlarge() {
+ return new EC2HardwareBuilder(InstanceType.C5_2XLARGE).c5()
+ .ram(16384)
+ .processors(ImmutableList.of(new Processor(8.0, 3.0)))
+ .rootDeviceType(RootDeviceType.EBS);
+ }
+
+ /**
+ * @see InstanceType#C5_4XLARGE
+ */
+ public static EC2HardwareBuilder c5_4xlarge() {
+ return new EC2HardwareBuilder(InstanceType.C5_4XLARGE).c5()
+ .ram(32768)
+ .processors(ImmutableList.of(new Processor(16.0, 3.0)))
+ .rootDeviceType(RootDeviceType.EBS);
+ }
+
+ /**
+ * @see InstanceType#C5_9XLARGE
+ */
+ public static EC2HardwareBuilder c5_9xlarge() {
+ return new EC2HardwareBuilder(InstanceType.C5_9XLARGE).c5()
+ .ram(73728)
+ .processors(ImmutableList.of(new Processor(36.0, 3.0)))
+ .rootDeviceType(RootDeviceType.EBS);
+ }
+
+ /**
+ * @see InstanceType#C5_18XLARGE
+ */
+ public static EC2HardwareBuilder c5_18xlarge() {
+ return new EC2HardwareBuilder(InstanceType.C5_18XLARGE).c5()
+ .ram(147456)
+ .processors(ImmutableList.of(new Processor(72.0, 3.0)))
+ .rootDeviceType(RootDeviceType.EBS);
+ }
+
/**
* @see InstanceType#D2_XLARGE
*/
diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/domain/InstanceType.java b/apis/ec2/src/main/java/org/jclouds/ec2/domain/InstanceType.java
index 53b3566f28..f7033e43af 100644
--- a/apis/ec2/src/main/java/org/jclouds/ec2/domain/InstanceType.java
+++ b/apis/ec2/src/main/java/org/jclouds/ec2/domain/InstanceType.java
@@ -487,6 +487,72 @@ public class InstanceType {
*/
public static final String C4_LARGE = "c4.large";
+ /**
+ * C5 Compute-optimized Large
+ *
+ * - 4 GiB of memory
+ * - 2 vCPU
+ * - No instance storage (EBS storage only)
+ * - Up to 25 Gbps of network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking
+ *
+ */
+ public static final String C5_LARGE = "c5.large";
+
+ /**
+ * C5 Compute-optimized X Large
+ *
+ * - 8 GiB of memory
+ * - 4 vCPU
+ * - No instance storage (EBS storage only)
+ * - Up to 25 Gbps of network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking
+ *
+ */
+ public static final String C5_XLARGE = "c5.xlarge";
+
+ /**
+ * C5 Compute-optimized 2x Large
+ *
+ * - 16 GiB of memory
+ * - 8 vCPU
+ * - No instance storage (EBS storage only)
+ * - Up to 25 Gbps of network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking
+ *
+ */
+ public static final String C5_2XLARGE = "c5.2xlarge";
+
+ /**
+ * C5 Compute-optimized 4x Large
+ *
+ * - 32 GiB of memory
+ * - 16 vCPU
+ * - No instance storage (EBS storage only)
+ * - Up to 25 Gbps of network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking
+ *
+ */
+ public static final String C5_4XLARGE = "c5.4xlarge";
+
+ /**
+ * C5 Compute-optimized 9x Large
+ *
+ * - 72 GiB of memory
+ * - 36 vCPU
+ * - No instance storage (EBS storage only)
+ * - Up to 25 Gbps of network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking
+ *
+ */
+ public static final String C5_9XLARGE = "c5.9xlarge";
+
+ /**
+ * C5 Compute-optimized 18x Large
+ *
+ * - 144 GiB of memory
+ * - 72 vCPU
+ * - No instance storage (EBS storage only)
+ * - Up to 25 Gbps of network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking
+ *
+ */
+ public static final String C5_18XLARGE = "c5.18xlarge";
+
/**
* D2 Dense Storage Extra Large
*
diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java
index 0409fbf344..c943ff58e6 100644
--- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java
+++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java
@@ -23,11 +23,17 @@ import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c3_4xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c3_8xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c3_large;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c3_xlarge;
+import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c4_large;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c4_2xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c4_4xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c4_8xlarge;
-import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c4_large;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c4_xlarge;
+import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c5_large;
+import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c5_xlarge;
+import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c5_2xlarge;
+import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c5_4xlarge;
+import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c5_9xlarge;
+import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c5_18xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.cc1_4xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.cc2_8xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.cg1_4xlarge;
@@ -124,6 +130,12 @@ public class AWSEC2HardwareSupplier extends EC2HardwareSupplier {
sizes.add(c4_2xlarge().build());
sizes.add(c4_4xlarge().build());
sizes.add(c4_8xlarge().build());
+ sizes.add(c5_large().build());
+ sizes.add(c5_xlarge().build());
+ sizes.add(c5_2xlarge().build());
+ sizes.add(c5_4xlarge().build());
+ sizes.add(c5_9xlarge().build());
+ sizes.add(c5_18xlarge().build());
sizes.add(i2_xlarge().build());
sizes.add(i2_2xlarge().build());
sizes.add(i2_4xlarge().build());