Giter Club home page Giter Club logo

awsbundle's Introduction

DEPRECATED By the time I started aws bundle there was no official library for Symfony. However there is a maintained official Symfony SDK, thus I deprecate this bundle in favor of it.


AWS Bundle

Build Status Test Coverage Code Climate SensioLabsInsight

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

Installation:

1. Download

Download the bundle:

composer require seferov/aws-bundle

2. Register

Enable the bundle in 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:
    credentials:
        key: AWS_KEY
        secret: AWS_SECRET
    region: AWS_REGION
    services:
        s3:
            credentials:
                key: AWS_S3_KEY
                secret: AWS_S3_SECRET
            region: AWS_S3_REGION
            version: '2006-03-01'
            endpoint: 'http://192.168.99.100:9324'	// Optional for local debug with service mocks
    # ...

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 official SDK documentation

awsbundle's People

Contributors

ahaaje avatar johanwilfer avatar manuelbcd avatar seferov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

awsbundle's Issues

How to use instance profile credentials

EC2 instances can provide instance profile credentials, to use instead of a user key pair. The SDK quick start guide has this to say

"You can also choose to forgo specifying credentials if you are relying on instance profile credentials". I tried configuring the bundle with setting they key and secret to null

seferov_aws:
key: null
secret: null

This give this error

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The path "seferov_aws.key" cannot contain an empty value, but got null.

Is there some other way to use instance profile credentials?

The "Symfony\Component\Config\Definition\Builder\TreeBuilder::root()" method called for the "seferov_aws" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead.

Q A
BC Break no
Version 3.0.0

Summary

After updated my Symfony project, I have got this deprecated message :

The "Symfony\Component\Config\Definition\Builder\TreeBuilder::root()" method called for the "seferov_aws" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead.

/var/www/html/vendor/seferov/aws-bundle/DependencyInjection/Configuration.php:28 {
    › $treeBuilder = new TreeBuilder();
    › $rootNode = $treeBuilder->root('seferov_aws');
  }

Posible solution

...
if (Kernel::VERSION_ID >= 40200) {
    $root = new TreeBuilder('seferov_aws');
} else {
    $builder = new TreeBuilder();
    $root = $builder->root('seferov_aws');
}
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.