Skip to content

AWS Credential resolution warning. #35

@ermi-ltd

Description

@ermi-ltd

Hi,

First up, thanks for taking on this project. It is exceptionally helpful and we appreciate all the work your putting into this.

Summary

Serverless appears to trigger a credential warning from the AWS-SDK in some situations. This may relate to the AWS credentials chain (discussed here: serverless/serverless#9290)

Description

I have started getting the following error when runningsis invoke local:

@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
    Multiple credential sources detected: 
    Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
    This SDK will proceed with the AWS_PROFILE value.
    
    However, a future version may change this behavior to prefer the ENV static credentials.
    Please ensure that your environment only sets either the AWS_PROFILE or the
    AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.

I've been debugging it this morning, and it appears to be coming from somewhere in the Serverless framework. The environment variables have not been set in the terminal running the command.

Expected behaviour

Running serverless commands should not trigger a warning about AWS credentials.

Actual behaviour

The error above it triggered when Serverless is run using the "invoke local" options.

Replication

  1. Create a lambda function with a node 22 runtime named "hello"
  2. Invoke the function locally sis invoke local -f hello
  3. Observer the warning about credentials.

Version:

$ serverless --version
osls version: 3.49.0

I'd appreciate any advice you can offer on how to resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions