Scalr\Modules\Platforms\Ec2\Helpers\EipHelper::checkElasticIp PHP Method

checkElasticIp() private static method

Checks Elastic IP availability
private static checkElasticIp ( string $ipaddress, Aws $aws ) : boolean
$ipaddress string public IP address
$aws Scalr\Service\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;
        }
    }