Skip to content

Credentials for DynamoDB from Lambda are not getting created properly #2805

@anuragnandan

Description

@anuragnandan

Describe the bug

Laravel application with DynamoDB as cache and session driver fails to connect due to credentials missing. I've been using the same config as before for v3.258 and started failing when updated to v3.281.12

Error: Credentials must be an instance of 'Aws\Credentials\CredentialsInterface, an associative array that contains "key", "secret", and an optional "token" key-value pairs, a credentials provider function, or false.Array

The same app works on EC2 with role that has same permissions as the Lambda role.

Expected Behavior

Load the app by opening connection to DynamoDB for session and cache storage

Current Behavior

Laravel App with bref/bref that enables the app to run on lambda as a function, started failing when aws-sdk-php package was updated to 3.281.12 with error related to credentials

Error: Credentials must be an instance of 'Aws\Credentials\CredentialsInterface, an associative array that contains "key", "secret", and an optional "token" key-value pairs, a credentials provider function, or false.Array

Upon adding more debug logs to the library when it creates AWS Client, I see that there's only token being generated in the credentials and not key or secret being passed.

Screenshot 2023-10-27 at 11 23 11 AM

Reproduction Steps

Load Laravel app with Bref on a Lambda function and dynamodb as cache or session driver

Possible Solution

No response

Additional Information/Context

No response

SDK version used

3.281.12

Environment details (Version of PHP (php -v)? OS name and version, etc.)

php 8.2 with arn:aws:lambda:us-east-2:534081306603:layer:php-82-fpm:48 layer

Metadata

Metadata

Assignees

Labels

guidanceQuestion that needs advice or information.response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions