Skip to content

S3TransferManagerAutoConfiguration doesn't use static credential/region provider #1424

@MilosHavranek

Description

@MilosHavranek

Type: Bug

Component: "S3"

Describe the bug
In AWSpring 3.3.1 it is noted that AWS launched new high level utility S3TransferManager
here: https://docs.awspring.io/spring-cloud-aws/docs/3.3.1/reference/html/index.html#using-s3transfermanager-and-crt-based-s3-client
With it on the classpath, classic S3 components are configured normally and create StaticCredentialsProvider.. which they use, however everything under S3TransferManager (S3TransferManagerAutoConfiguration) tries to obtain credentials/region through AWS SDK means (ENV property, instance profile, ...).

Sample

spring:
  cloud:
    aws:
      s3:
        enabled: true
      credentials:
        access-key: changeme
        secret-key: changeme
      region:
        static: changeme

pom.xml of Spring Boot 3.4.6, Spring Cloud 2024.0.1

    <!-- AWS Dependencies -->
    <dependency>
      <groupId>io.awspring.cloud</groupId>
      <artifactId>spring-cloud-aws-starter-s3</artifactId>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>s3-transfer-manager</artifactId>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

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