Skip to content

Commit

Permalink
OAP-224 oap-storage-cloud: jclouds -> aws sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
galaxina committed Nov 27, 2024
1 parent 1d219a7 commit ec72ba9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import oap.util.Lists;
import oap.util.Maps;
import org.jetbrains.annotations.NotNull;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.core.ResponseInputStream;
import software.amazon.awssdk.core.sync.RequestBody;
import software.amazon.awssdk.endpoints.Endpoint;
Expand Down Expand Up @@ -151,7 +153,11 @@ private S3Client getS3() {
S3EndpointParams s3EndpointParams = S3EndpointParams.builder().endpoint( "http://localhost:" + httpPort ).region( Region.AWS_GLOBAL ).build();
Endpoint s3Endpoint = new DefaultS3EndpointProvider().resolveEndpoint( s3EndpointParams ).join();

AwsBasicCredentials credentials = AwsBasicCredentials.create( "accessKeyId", "secretAccessKey" );
StaticCredentialsProvider provider = StaticCredentialsProvider.create( credentials );

return S3Client.builder()
.credentialsProvider( provider )
.endpointOverride( s3Endpoint.url() )
.region( Region.AWS_GLOBAL )
.forcePathStyle( true )
Expand Down

0 comments on commit ec72ba9

Please sign in to comment.