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

"Skipping creating StsCredentialsProvider" is misleading when only using StsAssumeRoleCredentialsProvider #862

Open
tekener opened this issue Aug 9, 2023 · 2 comments

Comments

@tekener
Copy link
Contributor

tekener commented Aug 9, 2023

Type: Bug

Component:
STS/Autoconfiguration

Describe the bug
We are only using an StsAssumeRoleCredentialsProvider to assume a role and not the StsWebIdentityTokenFileCredentialsProvider. So there is no need to provide an webIdentityTokenFile or other StsProperties.

Now the CredentialsProviderAutoConfiguration#createCredentialsProvider will log this warning because it founds the StsWebIdentityTokenFileCredentialsProvider dependency but no proper config for it:

Skipping creating `StsCredentialsProvider`. `software.amazon.awssdk:sts` is on the classpath, but neither `spring.cloud.aws.credentials.sts` properties are configured nor `AWS_WEB_IDENTITY_TOKEN_FILE` or the javaproperty `aws.webIdentityTokenFile` is set

But this config issue is only important for the case you want to use this StsWebIdentityTokenFileCredentialsProvider. So assuming we want to do the StsWebIdentityTokenFileCredentialsProvider based login only because this class is inside the class-path is not correct.

Seen in Spring AWS Cloud 3.0.1

Sample
Just put this dependency in your project and the log message will be shown:

    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>sts</artifactId>
    </dependency>

I would suggest to only log this warning if the StsProperties are not null and an error happens.

@cricketsamya
Copy link

Any solution?

@mahe-work
Copy link

Came here trying to find out what I have misconfigured. Very confusing indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants