ushios/aws-bundle

Symfony AwsBundle

Installs: 193

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

0.0.3 2013-10-30 14:41 UTC

This package is not auto-updated.

Last update: 2024-04-22 14:02:46 UTC


README

Create aws client using 'config.yml'.

Installation

composer.json

# composer.json

"require": {
    "ushios/aws-bundle": "0.0.*",
    …
}

and run composer update command.

AppKernel.php

# app/AppKernel.php

public function registerBundles()
{
    bundles = array(
        // ...
        new Ushios\Bundle\AwsBundle\UshiosAwsBundle(),
    );
    
    retrun bundles();
}

Confguration

config.yml

# app/config/config.php

ushios_aws:
    client:
        default:
            key: ${your_aws_key}
            secret: ${your_aws_secret_key}
            region: ap-northeast-1
        named:
            class: Your\Aws\Client # default: Aws\Common\Aws
            key: ${your_named_aws_key}
            secret: ${your_named_aws_secret_key}
            region: eu-west-1

Usage

Get client from service.

Using default settings aws client.

# Bundle/Controller/Controller.php

public function fooAction()
{
    $aws = $this->container->get('ushios_aws_client');
    // or
    $aws = $this->container->get('ushios_aws_client.default');
}

Using named settings.

# Bundle/Controller/Controller.php

public function fooAction()
{
    $aws = $this->container->get('ushios_aws_client.named');
    get_class($aws); // Your\Aws\Client
}

Client

@see aws/aws-sdk-php web siite