From 0ee68a5f836a654619a5bbf635e19e1d478f058e 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 + * + */ + public static final String C5_LARGE = "c5.large"; + + /** + * C5 Compute-optimized X Large + * + */ + public static final String C5_XLARGE = "c5.xlarge"; + + /** + * C5 Compute-optimized 2x Large + * + */ + public static final String C5_2XLARGE = "c5.2xlarge"; + + /** + * C5 Compute-optimized 4x Large + * + */ + public static final String C5_4XLARGE = "c5.4xlarge"; + + /** + * C5 Compute-optimized 9x Large + * + */ + public static final String C5_9XLARGE = "c5.9xlarge"; + + /** + * C5 Compute-optimized 18x Large + * + */ + public static final String C5_18XLARGE = "c5.18xlarge"; + /** * D2 Dense Storage Extra Large *