aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

Support endpoint override with environment variables

Open fkjaekel opened this issue 1 year ago • 6 comments

Describe the feature

I'm looking forward to use this feature with the Java SDK.

I was not able to get it working with the SSM client version 2.20.156 and there are no mentions to the Java SDK here.

Use Case

Be able to use SsmClient.create() instead of SsmClient.builder().endpointOverride(customUri).build() when AWS_ENDPOINT_URL or AWS_ENDPOINT_URL_SSM is set.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

AWS Java SDK version used

2.20.156

JDK version used

openjdk version "17.0.6" 2023-01-17

Operating System and version

Linux Mint 21.2

fkjaekel avatar Sep 28 '23 19:09 fkjaekel

The compatibility page also mentions this not being supported by the Java SDK v2: https://docs.aws.amazon.com/sdkref/latest/guide/feature-ss-endpoints.html#ss-endpoints-sdk-compat

BalmungSan avatar Sep 28 '23 20:09 BalmungSan

Feature request acknowledged.

Community note: if you want to show your support for this feature, add a 👍 to the description, it helps us with feature prioritization.

debora-ito avatar Sep 29 '23 22:09 debora-ito

Any progress on this? I am currently testing a Java app using LocalStack and it would be great to be able to switch between the real AWS endpoint and my local testing endpoint without changing any code. This feature is exactly what I am looking for currently and there aren't any other feasible workarounds I can use.

benvalkin avatar Oct 23 '23 11:10 benvalkin

Related issue here

mikiTesf avatar Jan 24 '24 07:01 mikiTesf

I am looking forward to it as well, but I have other (somewhat related) question - are there any plans/options to support providing the endpoints at runtime using System properties (similarly to the credentials)? If this is something that is worth a separate issue, then could you point me to the place I can create it (if it is not Java SDK only related)

MateuszWicherski avatar Feb 16 '24 08:02 MateuszWicherski

While @BalmungSan correctly points out that in the referenced compatibility matrix the Java SDK is currently listed as not supporting the feature, another page on the AWS documentation actually states it is supported: https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html#JVMSettings

At least for JVM properties, it states that You can use the following JVM system properties for the AWS SDK for Java and the AWS SDK for Kotlin (targeting the JVM) and lists aws.endpointUrl and aws.endpointUrl<ServiceName> as those. However, same as with the environment variables, it actually doesn't work with the aws java sdk.

Would be awesome to have this feature added soon as (at least for me) I'd finally get rid of all custom configurations when creating a S3 client and can rely on standardized configuration everywhere.

theodiefenthal avatar Mar 29 '24 12:03 theodiefenthal