private static checkElasticIp ( string $ipaddress, |
||
$ipaddress | string | public IP address |
$aws | AWS instance | |
return | boolean | Returns true if IP address is available. |
private static function checkElasticIp($ipaddress, \Scalr\Service\Aws $aws)
{
try {
$info = $aws->ec2->address->describe($ipaddress);
if (count($info)) {
return true;
} else {
return false;
}
} catch (Exception $e) {
return false;
}
}