Scalr\Modules\Platforms\Ec2\Helpers\EipHelper::checkElasticIp PHP 메소드

checkElasticIp() 개인적인 정적인 메소드

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