From e54312aaeb0f0947b7f941a9564555e6e7d5cc91 Mon Sep 17 00:00:00 2001 From: Vikas Rangarajan Date: Mon, 30 Jul 2018 18:25:30 -0500 Subject: [PATCH] JCLOUDS-1436: Add support for aws ec2 m5 instance types fix: remove duplicate imports --- .../compute/domain/EC2HardwareBuilder.java | 72 +++++++++++++++++++ .../org/jclouds/ec2/domain/InstanceType.java | 72 +++++++++++++++++++ .../suppliers/AWSEC2HardwareSupplier.java | 16 ++++- 3 files changed, 158 insertions(+), 2 deletions(-) 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 fbb730efcf..7d1a56c43f 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 @@ -239,6 +239,11 @@ public class EC2HardwareBuilder extends HardwareBuilder { return this; } + private EC2HardwareBuilder m5() { + virtualizationTypes(VirtualizationType.HVM); + return this; + } + private EC2HardwareBuilder c3() { virtualizationTypes(VirtualizationType.HVM, VirtualizationType.PARAVIRTUAL); return this; @@ -587,6 +592,73 @@ public class EC2HardwareBuilder extends HardwareBuilder { .rootDeviceType(RootDeviceType.EBS); } + /** + * @see InstanceType#M5_LARGE + */ + public static EC2HardwareBuilder m5_large() { + return new EC2HardwareBuilder(InstanceType.M5_LARGE).m5() + .ram(8192) + .processors(ImmutableList.of(new Processor(2, 2.5))) + .is64Bit(true) + .rootDeviceType(RootDeviceType.EBS); + } + + /** + * @see InstanceType#M5_XLARGE + */ + public static EC2HardwareBuilder m5_xlarge() { + return new EC2HardwareBuilder(InstanceType.M5_XLARGE).m5() + .ram(16384) + .processors(ImmutableList.of(new Processor(4, 2.5))) + .is64Bit(true) + .rootDeviceType(RootDeviceType.EBS); + } + + /** + * @see InstanceType#M5_2XLARGE + */ + public static EC2HardwareBuilder m5_2xlarge() { + return new EC2HardwareBuilder(InstanceType.M5_2XLARGE).m5() + .ram(32768) + .processors(ImmutableList.of(new Processor(8, 2.5))) + .is64Bit(true) + .rootDeviceType(RootDeviceType.EBS); + } + + /** + * @see InstanceType#M5_4XLARGE + */ + public static EC2HardwareBuilder m5_4xlarge() { + return new EC2HardwareBuilder(InstanceType.M5_4XLARGE).m5() + .ram(65536) + .processors(ImmutableList.of(new Processor(16, 2.5))) + .is64Bit(true) + .rootDeviceType(RootDeviceType.EBS); + } + + /** + * @see InstanceType#M5_12XLARGE + */ + public static EC2HardwareBuilder m5_12xlarge() { + return new EC2HardwareBuilder(InstanceType.M5_12XLARGE).m5() + .ram(196608) + .processors(ImmutableList.of(new Processor(48.0, 2.5))) + .is64Bit(true) + .rootDeviceType(RootDeviceType.EBS); + } + + /** + * @see InstanceType#M5_24XLARGE + */ + public static EC2HardwareBuilder m5_24xlarge() { + return new EC2HardwareBuilder(InstanceType.M5_24XLARGE).m5() + .ram(393216) + .processors(ImmutableList.of(new Processor(96.0, 2.5))) + .is64Bit(true) + .rootDeviceType(RootDeviceType.EBS); + } + + /** * @see InstanceType#C1_MEDIUM */ 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 f7033e43af..617cc39eee 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 @@ -268,6 +268,78 @@ public class InstanceType { */ public static final String M4_10XLARGE = "m4.10xlarge"; + /** + * M5 Large Instance + * + */ + public static final String M5_LARGE = "m5.large"; + + /** + * M5 Extra Large Instance + * + */ + public static final String M5_XLARGE = "m5.xlarge"; + + /** + * M5 Double Extra Large Instance + * + */ + public static final String M5_2XLARGE = "m5.2xlarge"; + + /** + * M5 Quadruple Extra Large Instance + * + */ + public static final String M5_4XLARGE = "m5.4xlarge"; + + /** + * M5 12x Extra Large Instance + * + */ + public static final String M5_12XLARGE = "m5.12xlarge"; + + /** + * M5 24x Extra Large Instance + * + */ + public static final String M5_24XLARGE = "m5.24xlarge"; + /** * High-CPU Medium Instance *