Skip to content

How to pass parameters in SesClient #21

@stavros-liaskos

Description

@stavros-liaskos

I have a difficulty passing the parameters to SesClient. At least that's what I believe given the error message. I tried countless configurations but I will forward only the one that seems correct to me.
composer show --installed:

aws/aws-sdk-php                          3.19.24 AWS SDK for PHP - Use Amazon Web Services in your PHP project
aws/aws-sdk-php-symfony                  1.2.0   A Symfony bundle for v3 of the AWS SDK for PHP
--- more ---

In my config.yml I have :

aws:
    key: myKey
    secret: topSecret
    region: eu-west-1
    version: latest

In my services.ymlI have:

services:
  aws.ses:
    class:  Aws\Ses\SesClient
    arguments:
        - [key, secret, region, version]

In my src/AppBundle/Controller/AwsController.php :

class AwsController extends Controller
{
    /**
     * @Route("/aws", name="aws")
     */
    public function awsAction()
    {
        $mailer = $this->get('aws.ses');
        return new Response ("");
    }
}

But I get this error:

Missing required client configuration options: 

region: (string)

A "region" configuration value is required for the "email" service
(e.g., "us-west-2"). A list of available public regions and endpoints can be
found at http://docs.aws.amazon.com/general/latest/gr/rande.html.

version: (string)

A "version" configuration value is required. Specifying a version constraint
ensures that your code will not be affected by a breaking change made to the
service. For example, when using Amazon S3, you can lock your API version to
"2006-03-01".

Your build of the SDK has the following version(s) of "email": * "2010-12-01"

You may provide "latest" to the "version" configuration value to utilize the
most recent available API version that your client's API provider can find.
Note: Using 'latest' in a production application is not recommended.

A list of available API versions can be found on each client's API documentation
page: http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html. If you are
unable to load a specific API version, then you may need to update your copy of
the SDK.

Any ideas on what am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.needs-responseWaiting on additional info and feedback from GitHub community. (no auto closure)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions