// TODO: Move the below code to use the InstanceInfoListener
// Refresh the amazon info including public IP if it has changed
ApplicationInfoManager.getInstance()
.refreshDataCenterInfoIfRequired();
// Get the co-ordinating Discovery Server
InstanceInfo discoveryServer = getCoordinatingServer();
// Check if the ami id has changed. If it has then it means
// there is a new eureka server deployment now
// Pass in the appinfo again since
if ((discoveryServer != null)
&& (Name.Amazon.equals(discoveryServer
.getDataCenterInfo()))) {
String amiId = ((AmazonInfo) discoveryServer
.getDataCenterInfo()).get(MetaDataKey.amiId);
if (discoveryServerAMIId == null) {
discoveryServerAMIId = amiId;
} else if (!discoveryServerAMIId.equals(amiId)) {
logger.info("The eureka AMI ID changed from "