A Symfony bundle for v3 of the AWS SDK for PHP

Installs: 3 488 448

Dependents: 20

Suggesters: 0

Security: 0

Stars: 268

Watchers: 37

Forks: 52

Open Issues: 8


2.2.2 2020-04-08 21:42 UTC

This package is auto-updated.

Last update: 2020-06-26 19:34:26 UTC


@awsforphp on Twitter Build Status Latest Stable Version Total Downloads

A Symfony bundle for including the AWS SDK for PHP.


The AWS bundle can be installed via Composer by requiring theaws/aws-sdk-php-symfony package in your project's composer.json:

    "require": {
        "aws/aws-sdk-php-symfony": "~2.0"

and adding an instance of Aws\Symfony\AwsBundle to your application's kernel:

class AppKernel extends Kernel
    public function registerBundles()
        return [
            new \Aws\Symfony\AwsBundle(),


By default, configuration is handled by the SDK rather than by the bundle, and no validation is performed at compile time. Full documentation of the configuration options available can be read in the SDK Guide.

If AWS_MERGE_CONFIG environment variable is set to true, configuration validation and merging are enabled. The bundle validates and merges known configuration options, including for each service. Additional configuration options can be included in a single configuration file, but merging will fail if non-standard options are specified in more than once.

To use a service for any configuration value, use @ followed by the service name, such as @a_service. This syntax will be converted to a service during container compilation. If you want to use a string literal that begins with @, you will need to escape it by adding another @ sign.

Sample configuration can be found in the tests/fixtures folder for YAML, PHP, and XML.

Sample YML Configuration

The sample configuration which can be placed in app/config/config.yml file.

    secret: "Rosebud was the name of his sled."

    version: latest
    region: us-east-1
        key: not-a-real-key
        secret: "@@not-a-real-secret" # this will be escaped as '@not-a-real-secret'
        region: us-west-2
        version: '2006-03-01'
        credentials: "@a_service"

        class: Aws\Credentials\Credentials
            - a-different-fake-key
            - a-different-fake-secret


This bundle exposes an instance of the Aws\Sdk object as well as instances of each AWS client object as services to your symfony application. They are name aws.{$namespace}, where $namespace is the namespace of the service client. For instance:

Service Instance Of
aws.dynamodb Aws\DynamoDb\DynamoDbClient
aws.ec2 Aws\Ec2\Ec2Client
aws.s3 Aws\S3\S3Client
aws_sdk Aws\Sdk

The services made available depends on which version of the SDK is installed. To view a full list, run the following command from your application's root directory:

php bin/console debug:container aws

Full documentation on each of the services listed can be found in the SDK API docs.