2

I am trying to setup SQS to use AWS Instance Profile instead of key and secret using Laravel 8.

I have tried the following in queue.php

'sqs' => [
            'driver' => 'sqs',
            'credentials' => CredentialProvider::memoize(CredentialProvider::instanceProfile()),
            'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
            'queue' => env('SQS_QUEUE', 'your-queue-name'),
            'region' => env('SQS_REGION', 'us-east-1'),
        ],

however, this gave me an error Your configuration files are not serializable.

I know that removing the credentials key completely will by default force the sdk to use the default credentials provider, however, I am wondering if there is a way to use CredentialProvider::instanceProfile() instead since default credentials provider will look for keys in other places first then move on to Instance Profile role after the previous attempts failed (which I think is inefficient).

Can anyone help me with this?

ocind
  • 149
  • 1
  • 13

0 Answers0