TystrAwsBundle
, (*1)
This bundle integrates the AWS SDK for PHP into symfony2., (*2)
Installation
Add the following to your composer.json:, (*3)
{
"require": {
"tystr/aws-bundle": "dev-master@dev"
}
}
Install the bundle using composer:, (*4)
$ php composer.phar update tystr/aws-bundle
Finally, register the bundle with your application:, (*5)
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Tystr\Bundle\AwsBundle\TystrAwsBundle()
);
}
Now you'll just need to set some configuration parameters, and you're ready to go!, (*6)
Configuration
Configuration is pretty simple. Each parameter you set here is passed to the factory which will create any aws service you request., (*7)
tystr_aws:
access_key: YOUR_AWS_ACCESS_KEY
secret_access_key: YOUR_AWS_SECRET_ACCESS_KEY
region: us-east-1 # You must set a default region to be passed to the aws clients
See the full default configuration in the Configuration Reference section of the docs., (*8)
Usage
For example, to fetch an instance of the s3 client:, (*9)
$s3 = $this->get('tystr_aws.s3');
The following services are exposed by this bundle:, (*10)
tystr_aws.s3 |
tystr_aws.route53 |
tystr_aws.ec2 |
tystr_aws.autoscaling |
tystr_aws.cloudformation |
tystr_aws.cloudfront |
tystr_aws.cloudsearch |
tystr_aws.coudtrail |
tystr_aws.cloudwatch |
tystr_aws.datapipeline |
tystr_aws.directconnect |
tystr_aws.dynamodb |
tystr_aws.elasticache |
tystr_aws.elasticbeanstalk |
tystr_aws.elb |
tystr_aws.elastictranscoder |
tystr_aws.em |
tystr_aws.glacier |
tystr_aws.iam |
tystr_aws.importexport |
tystr_aws.kinesis |
tystr_aws.opsworks |
tystr_aws.rds |
tystr_aws.redshift |
tystr_aws.ses |
tystr_aws.simpledb |
tystr_aws.sns |
tystr_aws.sqs |
tystr_aws.storagegateway |
Profit!, (*11)