Skip to content

v3.830.0 ISSUE: fromEnv() suddenly now does not leverage credentials from AWS Lambda execution role #7132

Closed
@tfrancois

Description

@tfrancois

Checkboxes for prior research

Describe the bug

All of a sudden, all of my Lambda functions that used fromEnv() to reference the environment variables that are automatically provided by the execution role it is running under stopped working and hangs function execution until it times out.

According to the AWS documentation the following should always be true:

AWS Lambda functions automatically assume an IAM role, also known as the execution role, which grants them permissions to access other AWS services. This role's temporary credentials, including access key ID, secret access key, and session token, are made available to the Lambda function's environment as environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN. These variables are automatically injected by Lambda and should not be manually configured by the user.

After upgrading on my local dev environment to v3.830.0 of the AWS SDK and running my functions in the AWS production runtime environments this suddenly stopped working. They hang when it encounters fromEnv() usage:

{ ... credentials: fromEnv() }

This used to work flawlessly up until a couple of days ago. The workaround was to remove the fromEnv() entirely and the functions work as normally as before. Not sure if this is intended or the proper resolution to this new issue. Please advise and thank you.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/package-name@version, ...

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

NodeJS v18.20.3

Reproduction Steps

To reproduce this issue, simply use fromEnv() when instantiating a new DynamoDB client on NodeJS v18.20.3 or higher:

new DynamoDBClient({ 'region': region, 'credentials': fromEnv() }

Observed Behavior

Execution of the function hangs because the promise never gets resolved or rejected - it just hangs until it times out. Upon further investigation and searching through logs, the underlying error seems to be the following:

Unable to find environment variable credentials

Expected Behavior

The function should leverage the environment variables automatically provided by the execution role of the Lambda function its running under.

Possible Solution

No response

Additional Information/Context

No response

Activity

added
bugThis issue is a bug.
needs-triageThis issue or PR still needs to be triaged.
on Jun 17, 2025
changed the title [-]v3.830.0 Issue: fromEnv suddenly now does not leverage credentials from AWS Lambda role credentials[/-] [+]v3.830.0 ISSUE: fromEnv() suddenly now does not leverage credentials from AWS Lambda role credentials[/+] on Jun 17, 2025
changed the title [-]v3.830.0 ISSUE: fromEnv() suddenly now does not leverage credentials from AWS Lambda role credentials[/-] [+]v3.830.0 ISSUE: fromEnv() suddenly now does not leverage credentials from AWS Lambda execution role[/+] on Jun 17, 2025
aBurmeseDev

aBurmeseDev commented on Jun 20, 2025

@aBurmeseDev
Contributor

Hi @tfrancois - thanks for reaching out.

Can you share your code snippet, error logs and env variables?

This used to work flawlessly up until a couple of days ago. The workaround was to remove the fromEnv() entirely and the functions work as normally as before.

I'm not seeing any major change in recent versions, have you changed any env variables?

self-assigned this
on Jun 20, 2025
added
response-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
p3This is a minor priority issue
and removed
needs-triageThis issue or PR still needs to be triaged.
on Jun 20, 2025
tfrancois

tfrancois commented on Jun 21, 2025

@tfrancois
Author

Hi @aBurmeseDev - thank you for your prompt reply to this issue. I'm embarrassed - the issue was definitely on my end. Everything seems to be working as expected - I'm not sure what I was doing incorrectly but issue went away unexpectedly. Thanks again!

github-actions

github-actions commented on Jun 21, 2025

@github-actions

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

github-actions

github-actions commented on Jul 6, 2025

@github-actions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

locked as resolved and limited conversation to collaborators on Jul 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p3This is a minor priority issueresponse-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

      Participants

      @tfrancois@aBurmeseDev

      Issue actions

        v3.830.0 ISSUE: fromEnv() suddenly now does not leverage credentials from AWS Lambda execution role · Issue #7132 · aws/aws-sdk-js-v3