Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

348
Views
How do I use S3 VPC endpoint in Java?

What is the way to get an S3 object using the VPC endpoint for S3 in JAVA? Shall I use a simple http-client? Or is there a way to do this using AmazonS3ClientBuilder?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You don't do anything differently when using an S3 VPC endpoint after you configure it. Nothing in your code changes.

When a subnet in a VPC is associated with a route table that is configured for a VPC endpoint, only one thing happens:

  • all of the public IP addresses for S3 in your region are routed to the VPC endpoint instead of following the default route.

That's it.

The prefix list pl-xxxxxxxx in your route table represents a list of all the public subnets associated with S3 in your region. The list is automatically maintained by the AWS infrastructure. When an instance sends traffic to S3, it does a DNS lookup to find an IP address for the bucket. When it connects to that IP address, if the route table for the instance's subnet includes an entry for that prefix list using the VPC endpoint for S3, it connects to S3 over the endpoint.

All instances in subnets associated with the specified route tables automatically use the endpoint to access the service; subnets that are not associated with the specified route tables do not use the endpoint to access the service.

http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html#vpc-endpoints-routing

over 4 years ago · Santiago Trujillo Report

0

The AmazonS3ClientBuilder can be used to build a client that can connect to a specific end-point. There is no need to write your own low-level client!

Here's an example:

BasicAWSCredentials myCredentials = new BasicAWSCredentials("access_key", "secret_key");
AWSCredentialsProvider myCredentialsProvider = new StaticAWSCredentialsProvider(myCredentials);
String myEndpoint = ".."; // set your endpoint here
String myRegion = "..";   // set your region (ie. us-east-1, or us-east-1 etc.)

AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
            .withCredentials(myCredentialProvider)
            .withEndpoint(myEndpoint)
            .withRegion(myRegion)
            .build();
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!