|
|
@@ -44,7 +44,7 @@ public class AmazonEC2Driver extends ComputeServiceDriverBase { |
|
|
|
|
|
|
|
private AmazonEC2 initEC2Client() { |
|
|
|
final Regions region; |
|
|
|
final String regionName = config.getRegion(Regions.DEFAULT_REGION.getName()).getName(); |
|
|
|
final String regionName = config.getConfig("region"); |
|
|
|
try { |
|
|
|
region = Regions.valueOf(regionName); |
|
|
|
} catch (Exception e) { |
|
|
@@ -90,15 +90,15 @@ public class AmazonEC2Driver extends ComputeServiceDriverBase { |
|
|
|
|
|
|
|
@Override public BubbleNode start(BubbleNode node) throws Exception { |
|
|
|
|
|
|
|
RunInstancesRequest runInstancesRequest = new RunInstancesRequest().withImageId(config.getImageId()) |
|
|
|
.withInstanceType(config.getInstanceType()) |
|
|
|
RunInstancesRequest runInstancesRequest = new RunInstancesRequest().withImageId(config.getConfig("imageId")) |
|
|
|
.withInstanceType(config.getConfig("instanceType")) |
|
|
|
.withMinCount(MIN_COUNT) |
|
|
|
.withMaxCount(MAX_COUNT) |
|
|
|
.withKeyName(node.getUuid()) |
|
|
|
.withNetworkInterfaces(new InstanceNetworkInterfaceSpecification() |
|
|
|
.withAssociatePublicIpAddress(true) |
|
|
|
.withSubnetId(SUBNET_ID_PREFIX + node.getUuid()) |
|
|
|
.withGroups(config.getGroup())); |
|
|
|
.withGroups(config.getConfig("group"))); |
|
|
|
|
|
|
|
final AmazonEC2 ec2Client = getEc2Client(); |
|
|
|
RunInstancesResult runInstancesResult = ec2Client.runInstances(runInstancesRequest); |
|
|
|