Description
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?