Closed giagara closed 4 months ago
I recommend you trim your configuration like this:
'sqs' => [
'driver' => 'sqs',
'prefix' => env('SQS_PREFIX', 'https://sqs.eu-west-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'after_commit' => false,
],
'another-queue' => [
'driver' => 'sqs',
'prefix' => env('SQS_PREFIX', 'https://sqs.eu-west-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE_ANOTHER_QUEUE', 'another-queue'),
'suffix' => env('SQS_SUFFIX'),
'after_commit' => false,
],
I would even go one step further and remove prefix
and suffix
in favor of having everything in queue
I recommend you trim your configuration like this:
'sqs' => [ 'driver' => 'sqs', 'prefix' => env('SQS_PREFIX', 'https://sqs.eu-west-1.amazonaws.com/your-account-id'), 'queue' => env('SQS_QUEUE', 'default'), 'suffix' => env('SQS_SUFFIX'), 'after_commit' => false, ], 'another-queue' => [ 'driver' => 'sqs', 'prefix' => env('SQS_PREFIX', 'https://sqs.eu-west-1.amazonaws.com/your-account-id'), 'queue' => env('SQS_QUEUE_ANOTHER_QUEUE', 'another-queue'), 'suffix' => env('SQS_SUFFIX'), 'after_commit' => false, ],
I would even go one step further and remove
prefix
andsuffix
in favor of having everything inqueue
I copied it from the dev env where I have all parameters. Anyway, that's not concern to the issue I've got.
Apparently to achieve this you have to set it in a ServiceProvider (or whatever you want):
Config::set('queue.connections.<queue-connection>.token', env('AWS_SESSION_TOKEN'));
I'm creating a PR to the docs to explain it.
I have multiple connection in my queue.php config file like:
in my code i execute something like
The default queue is working and the "other" returns:
{"__type":"com.amazon.coral.service#UnrecognizedClientException","message":"The security token included in the request i (truncated...)
: The security token included in the request is invalidFrom what i can debug i see that the "other" configuration is missing the
AWS_SESSION_TOKEN
stored in thetoken
property of the connection's config. I think this is related to this: https://github.com/brefphp/laravel-bridge/blob/1dd21c63c3b14a12b4a73bb79fbc2854d2556349/src/BrefServiceProvider.php#L50Have i to set the
AWS_SESSION_TOKEN
in a custom ServiceProvider? Like:Config::set('queue.connections.another-queue.token', env('AWS_SESSION_TOKEN'));
I didn't see anything in the doc related to a custom sqs connection.