Skip to content

S3 AutoConfiguration not using Credentials Setup #1385

Open
@bueno-felipe

Description

@bueno-felipe

Type: Bug

Component:

S3

Describe the bug
I'm using spring-cloud-aws 3.1.1 but even in the latest version I guess the issue happens.
Looking at all integrations auto configuration classes (like SQS, SNS, ...), they're annotated with the following:

@AutoConfigureAfter({ CredentialsProviderAutoConfiguration.class, RegionProviderAutoConfiguration.class })

But the S3AutoConfiguration class isn't, which implies that the S3Client isn't inheriting the authentication providing the following error in my EKS environment:

The AWS Access Key Id you provided does not exist in our records.

The DefaultCredentialsProvider has lots of ways/fallbacks to providing the necessary credentials, and in my environment I'm using Web Identity Token credentials from pod environment variables, which works pretty well with the SqsAsyncClient, but it doesn't with S3Client, and I believe the reason why, is this missing annotation in the S3AutoConfiguration class. (Correct me if I'm wrong).

I know that one possible solution is to provide in my Spring application a custom configuration for the S3Client bean setting up the StsWebIdentityTokenFileCredentialsProvider, that's what I'm going to try right now, but IMHO this is expected to work out of box using the S3AutoConfiguration.

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