public function getPublicDnsName()
{
// make sure we have a host to work with
$this->requiresValidHost(__METHOD__);
// what are we doing?
$log = usingLog()->startAction("get the public DNS name for EC2 VM '{$this->instanceName}'");
// here are the details, as a string
$dnsName = $this->instance['PublicDnsName'];
// does it *have* a public DNS name?
if (empty($dnsName)) {
$log->endAction("EC2 VM does not have a public DNS name; has it finished booting?");
return null;
}
// all done
$log->endAction("public DNS name is: '{$dnsName}'");
return $dnsName;
}