Skip to content

AWS Java SDK v2: Endpoint Override with a custom endpoint in IAM Client

0

I am encountering an issue with the AWS SDK v2 for Java when trying to override the endpoint for the IAM Client. Specifically, the SDK is stripping everything after the ‘/’ in the endpoint that I have specified. As a result, it is hitting the wrong endpoint.

Here is the code snippet I am using to override the endpoint:

IamClient iamClient = IamClient.builder()
    .endpointOverride(URI.create("https://custom-endpoint.com/path/"))
    .build();

However, the SDK seems to strip the ‘/path/’ part, and the request is sent to https://custom-endpoint.com instead of https://custom-endpoint.com/path/.

Has anyone else faced this issue? Is this the expected behavior from the SDK? Is there a workaround or a fix for this behavior?

asked a year ago139 views