Skip to content

Failed to set Endpoint via EndpointProdiver or endpointUrl in S3Client #842

@hantsy

Description

@hantsy

Describe the bug

I tried to update my codes to use the latest AWS SDK Kotlin 0.20.1-beta, found the endpointResolver is removed.

I have tried to used the following two approaches to set endpoint, but failed.

S3Client {
       // other config.
        endpointProvider = properties.endpoint?.let { url ->
            EndpointProvider { params ->
                Endpoint(url)                }
        }
}

or set it via endpointUrl.

S3Client {
       // other config.
        endpointUrl = properties.endpoint?.let { Url.parse(it) }
}

The properties.endpoint is http://localhost:4566/ in local testing env.

Expected behavior

It should work as EndpointResolver. The old config worked well in a previous version.

 endpointResolver = properties.endpoint?.let {
            StaticEndpointResolver(
                AwsEndpoint(it)
            )
       }

Current behavior

I got the exception like this when calling the S3Client in my codes.

	error=exception while calling s3 with unknown operation: Unable to find operation for request to service s3: PUT /

Steps to Reproduce

I used a localstack to mock all AWS locally, so I need to setup the endpoint to http://localhost:4566

Possible Solution

No response

Context

No response

AWS Kotlin SDK version used

0.20.1-beta

Platform (JVM/JS/Native)

Java 17

Operating System and version

Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions