Amazon S3 connection

Hi Alexaner,

Thanks the for the information and the update on the development. I managed to find a workaround so I will post the solution here in case others need it. Here is a Java Snippet that allows you to list the buckets in a string (can be further developed but should give an idea on how to make the connection).

Module dependencies:
Capture

Code:

// Your custom imports:
import com.amazonaws.auth.*;
import com.amazonaws.services.s3.*;
import com.amazonaws.client.builder.*;
import java.util.List;
import com.amazonaws.services.s3.model.Bucket;

// Enter your code here:
AWSCredentials credentials = new BasicAWSCredentials(
  "ENTER YOUR ACCESS KEY HERE", 
  "ENTER YOUR SECRET KEY HERE"
);
try {
 AmazonS3 s3client = AmazonS3ClientBuilder.standard()
 .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(
      "ENTER CUSTOM ENDPOINT HERE",
      "ENTER REGION HERE"))
 .withCredentials(new AWSStaticCredentialsProvider(credentials))
 .build();

List<Bucket> buckets = s3client.listBuckets();

String name = "";
for(Bucket bucket : buckets) {
   name += bucket.getName() + ", ";
}
   out_result = name;
}
catch (Exception e) {
   out_result =  e.toString();
}
4 Likes