Skip to content

Change S3 provider endpoint #13

@liquid36

Description

@liquid36

Hi! i want to use another S3 provider than AWS. But it is not possible to set S3_ENDPOINT by env variables.

I'm not expert in Java but i made some research, it seems to be possible by doing something like this:

String endpoint = System.getenv("AWS_S3_ENDPOINT");   
URI endpointUri = endpoint != null ? URI.create(endpoint) : null;

S3Client.Builder builder = S3Client.builder()
    .region(Region.US_EAST_1)
    .credentialsProvider(DefaultCredentialsProvider.create());

if (endpointUri != null) {
    builder.endpointOverride(endpointUri); 
}

S3Client s3 = builder.build();

Could you implement it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions