try {
EC2Client ec2Client = new EC2Client(args[0], args[1]);
String elasticIP = System.getenv("ELASTIC_IP");
// Assign the elastic IP to itself, if not already assigned
List<Address> addressList = ec2Client.describeAddresses(new String[]{elasticIP});
String localInstanceId = System.getenv("instance_id");
// Associate this address with this instance only if any other instance has not assigned it to itself
for (Address address : addressList) {
if (address.getInstance() == null) {