String awsRegion) {
Assert.hasText(awsAccessKey, "awsAccessKey must not be empty nor null");
Assert.hasText(awsSecretKey, "awsSecretKey must not be empty nor null");
Assert.hasText(awsRegion, "awsRegion must not be empty nor null");
AWSEC2Api client = ContextBuilder.newBuilder("aws-ec2")
.credentials(awsAccessKey, awsSecretKey)
.buildApi(AWSEC2Api.class);
Set<? extends Reservation<? extends AWSRunningInstance>> reservations = client
.getInstanceApi().get().describeInstancesInRegion(awsRegion);
int instanceCount = reservations.size();
ArrayList<RunningInstance> result = new ArrayList<RunningInstance>();
for (int awsRunningInstanceCount = 0; awsRunningInstanceCount < instanceCount; awsRunningInstanceCount++) {
Reservation<? extends AWSRunningInstance> instances = Iterables