Skip to content

ahaaje/awsBundle

 
 

Repository files navigation

AWS Bundle

Build Status Scrutinizer Code Quality SensioLabsInsight

Amazon Web Services Symfony Bundle built on the top of official AWS SDK.

Available services: CloudFront, CloudSearch, CloudWatch, DynamoDB, EC2, EMR, Elastic Transcoder, ElastiCache, Glacier, Redshift, RDS, Route 53, SES, SNS, SQS, S3, SWF, SimpleDB, AutoScaling, CloudFormation, CloudTrail, DataPipeline, DirectConnect, ElasticBeanstalk, IAM, ImportExport, OpsWorks, STS, StorageGateway, Support, ElasticLoadBalancing

Installation:

1. Download

Add to your composer.json

{
    "require": {
        "seferov/aws-bundle": "~1.2"
    }
}

Download the bundle:

php composer.phar update seferov/aws-bundle

Or simply you can run the command:

php composer.phar require seferov/aws-bundle:~1.2

2. Register

Enable the bundle in the kernel:

// app/AppKernel.php
// ...
public function registerBundles()
{
    $bundles = array(
        // ...
        new Seferov\AwsBundle\SeferovAwsBundle(),
    );
}

3. Configure

Add the following configuration to your app/config/config.yml

Example:

seferov_aws:
    key: AWS_KEY
    secret: AWS_SECRET
    region: AWS_REGION
    services:
        s3:
            key: AWS_S3_KEY
            secret: AWS_S3_SECRET
            region: AWS_S3_REGION
    # ...

Service names are underscored, such as elastic_beanstalk.

For further configuration see Configuration page.

Usage

Example:

// AWS S3 example
public function someAction()
{
    $client = $this->get('aws.s3');

    // Upload an object to Amazon S3
    $result = $client->putObject(array(
        'Bucket' => $bucket,
        'Key'    => 'data.txt',
        'Body'   => 'Hello!'
    ));
    // ...
}

For more reference check offical SDK documentation

About

Symfony AWS Bundle

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%