Describe the bug When trying to set a custom endpoint for the S3 backend the following error is thrown Caused by: java.lang.UnsupportedOperationException: Client is immutable when created with the builder. Looking through code code the endpoint needs to be set against the builder and cannot be set on the AmazonS3 client after it's been built by the builder (code from the builder below) builder code

@SdkInternalApi
final TypeToBuild configureMutableProperties(TypeToBuild clientInterface) {
    AmazonWebServiceClient client = (AmazonWebServiceClient) clientInterface;
    setRegion(client);
    client.makeImmutable();
    return clientInterface;
}

The code in the AmazonS3EnvironmentRepositoryFactory would need to be changed to the following to allow for the endpoint to be set something like the below

if (environmentProperties.getEndpoint() != null) {
     clientBuilder.setEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(environmentProperties.getEndpoint(), null));
}
final AmazonS3 client = clientBuilder.build();

Sample

spring:
  cloud:
    config:
      server:
        awss3:
          endpoint: http://localhost:8080

Comment From: spencergibb

I think this duplicates #1597

Comment From: celdridge91190

Yeah those look to have the same root cause.