Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple credential sources warning: How to suppress warning message? #6548

Open
tfrancois opened this issue Oct 7, 2024 · 3 comments
Open
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@tfrancois
Copy link

          This warning is emitted here in the default provider chain rather than in the `fromEnv` provider function.

The reason for this is because when using the fromEnv provider in isolation, it doesn't matter if the AWS_PROFILE is set or not.

Originally posted by @kuhe in #6277 (comment)

@tfrancois
Copy link
Author

Is there a way to suppress this message when using the createCredentialChain method with the fromEnv and the default profile configured on a workstation/server?

@kuhe kuhe added the needs-triage This issue or PR still needs to be triaged. label Oct 10, 2024
@kuhe
Copy link
Contributor

kuhe commented Oct 10, 2024

You should unset the credentials that you aren't using to avoid the warning.

There is also a manual way:

new Client({
  logger: {
	trace() {},
	debug() {},
    info() {}, 
    warn(arg) {
      if (arg.includes("Multiple credential sources detected")) {
      } else {
        console.warn(arg);
      }
    },
    error: console.error,
  }
});

@kuhe kuhe added the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Oct 10, 2024
@zshzbh zshzbh added p2 This is a standard priority issue guidance General information and guidance, answers to FAQs, or recommended best practices/resources. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 14, 2024
@kuhe kuhe removed their assignment Oct 15, 2024
Copy link

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants