Beispiel #1
0
 public function __construct($accessKeyId, $secretAccessKey, $bucket, $region, $host)
 {
     $this->bucket = $bucket;
     $this->host = $host;
     $this->accesKeyId = $accessKeyId;
     $this->aws = Aws::factory(array('key' => $accessKeyId, 'secret' => $secretAccessKey, 'region' => $region));
     $this->s3 = $this->aws->get('s3');
 }
 function getSnsClient()
 {
     if ($this->snsClient) {
         return $this->snsClient;
     }
     $this->snsClient = $this->aws->get('sns');
     $this->snsClient->setRegion($this->topicRegion);
     return $this->snsClient;
 }
Beispiel #3
0
 public function getPublicDNSFromEBEnvironmentName($envName)
 {
     $ec2Client = $this->providedAws->get('ec2');
     $result = $ec2Client->describeInstances(array('Filters' => array(array('Name' => 'tag-key', 'Values' => array('elasticbeanstalk:environment-name')), array('Name' => 'tag-value', 'Values' => array($envName)))));
     $dnsArray = array();
     //ugh, no dot notation checks
     $reservations = $result->get('Reservations', array());
     if (count($reservations) > 0) {
         foreach ($reservations as $reservation) {
             if (isset($reservation['Instances']) && count($reservation['Instances']) > 0) {
                 $instance = $reservation['Instances'][0];
                 $dnsArray[] = $instance['PublicDnsName'];
             }
         }
     }
     return $dnsArray;
 }
Beispiel #4
0
 /**
  * Get aws object or aws service
  *
  * @return mixed
  */
 protected function getAws($service = null)
 {
     if (is_null($this->aws)) {
         $this->aws = Aws::factory($this->getAwsCredentials());
     }
     if (!is_null($service)) {
         return $this->aws->get($service);
     }
     return $this->aws;
 }
 /**
  * @param Aws $aws
  * @return DynamoDbClient
  */
 private function getDynamoDbClient(Aws $aws)
 {
     return $aws->get('dynamodb');
 }
Beispiel #6
0
 /**
  * Returns the instance of the client that the facade operates on
  *
  * @return \Aws\Common\Client\AwsClientInterface
  */
 public static function getClient()
 {
     return self::$serviceBuilder->get(static::getServiceBuilderKey());
 }
 public function __construct(Aws $aws, LoggerInterface $logger)
 {
     parent::__construct();
     $this->client = $aws->get('ElasticBeanstalk');
     $this->logger = $logger;
 }
 /**
  * @return SqsClient
  */
 function getSqs()
 {
     return $this->aws->get('sqs');
 }
 /**
  * 
  *
  * @static 
  */
 public static function get($name, $throwAway = false)
 {
     //Method inherited from \Guzzle\Service\Builder\ServiceBuilder
     return \Aws\Common\Aws::get($name, $throwAway);
 }
 /**
  * @return SwfClient
  */
 public function getSwfClient()
 {
     /** @var $client SwfClient */
     $client = $this->awsBaseServiceFactory->get(self::AWS_SERVICE_SWF);
     return $client;
 }