Skip to content

spring.cloud.aws.region.static not picked up (v3.3.0) #1366

Open
@erihanse

Description

@erihanse

I'm trying to configure a DynamoDbClient for local integration tests but I get the error

Unable to load region from any of the providers in the chain software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain

I've been reading https://docs.awspring.io/spring-cloud-aws/docs/3.2.0/reference/html/index.html#region. I have no .aws folder, and from what I understand spring.cloud.aws.region.static should set the region.

I have my dependencies declared like this:

dependencyManagement {
    imports {
        mavenBom("org.springframework.boot:spring-boot-dependencies:3.3.5")
        mavenBom("org.springframework.cloud:spring-cloud-dependencies:2024.0.1")
    }
}

dependencies {
    implementation("io.awspring.cloud:spring-cloud-aws-starter")
    implementation("io.awspring.cloud:spring-cloud-aws-starter-dynamodb")
    implementation(platform("io.awspring.cloud:spring-cloud-aws-dependencies:3.3.0"))
}

and an application.yaml:

spring:
  cloud:
    aws:
      dynamodb:
        endpoint: http://localhost:4566
        region: eu-west-1
      credentials:
        access-key: dummy
        secret-key: dummy
      region:
        static: eu-west-1

The line that fails is:

private var enhancedClient: DynamoDbEnhancedClient? = DynamoDbEnhancedClient.create()

The point is to not having to resort to environment variables or system properties but use the properties in application.yaml. Have I not set up auto configuration correct or am I misunderstanding what these properties are meant to do?

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