/** * Create Amazon Elastic Load Balancing client. * * @param string $access_key Override the default Access Key * @param string $secret_key Override the default Secret Key * @param string $region Sets the AWS Region * @return void */ public function __construct($accessKey = null, $secretKey = null, $region = null) { parent::__construct($accessKey, $secretKey, $region); if (!$this->_region) { $message = "Region must be set in order to use EC2 ELB"; throw new Zend_Service_Amazon_Ec2_Exception($message); } }
/** * Set which region you are working in. It will append the * end point automaticly * * @param string $region */ public static function setRegion($region) { if (in_array(strtolower($region), self::$_validEc2Regions, true)) { self::$_defaultRegion = $region; } else { require_once 'Zend/Service/Amazon/Exception.php'; throw new Zend_Service_Amazon_Exception('Invalid Amazon Ec2 Region'); } }