Questions tagged [aws-java-sdk-2.x]

The AWS SDK for Java provides a Java API for Amazon Web Services. Using the SDK, you can easily build Java applications that work with Amazon S3, Amazon EC2, DynamoDB, and more.

Version 2.x is a major rewrite of the 1.11.x code base. Built with support for Java 8+, 2.x adds several frequently requested features, like nonblocking I/O, improved start-up performance and automatic iteration over paginated responses. In addition, many aspects of the SDK have been updated with a focus on consistency, immutability, and ease of use.

Links

74 questions
12
votes
1 answer

Get authentication token from AWS EKS using the AWS Java SDK v2

How can I get a Kubernetes authentication token from AWS EKS using the AWS Java SDK v2? An authentication token that can then be used to authenticate with Kubernetes using a Kubernetes SDK. In other words I want to get an authentication token from…
6
votes
1 answer

Get an S3Object from a GetObjectResponse in AWS Java SDK 2.0

In AWS Java SDK 1.x, I could get an S3Object from an S3Client like this. S3Object obj = mS3Client.getObject(pBucket, pKey); I'm trying to replicate that functionality using AWS Java SDK 2.0 (and end up with an S3Object), but the closest I can get…
the_storyteller
  • 1,913
  • 20
  • 30
5
votes
1 answer

Get AWS S3 bucket web static site URL programmatically using Java SDK v2

The documentation at https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html says that there are two major forms based upon region: bucket-name.s3-website-region.amazonaws.com bucket-name.s3-website.region.amazonaws.com (Note the…
Garret Wilson
  • 14,167
  • 20
  • 115
  • 211
4
votes
1 answer

How to check if bucket already exists in AWS S3

How can I check if the bucket already exists in my Aws S3 account using Java SDK? Using below code AmazonS3ClientBuilder.defaultClient().doesBucketExistV2(bucketName); Checks global existence of bucket and returns true if a bucket with this…
4
votes
1 answer

AWS SDK Java version 2 - is there an equivalent to doesObjectExist() from ver 1?

The S3 client in the AWS Java SDK ver 1 had a method to check for the existence of an object in a bucket doesObjectExist(bucketName, objectName) In version 2 of the SDK I don't see anything similar but I wanted to see if I was missing anything. The…
menapole
  • 1,116
  • 1
  • 9
  • 19
3
votes
1 answer

How to generate AWS credential report for all accounts in an organization

I am looking to generate a AWS credential report for all the accounts under an organization. Is there any way to generate the consolidated report of accounts. I know we can generate a credential report per account (one) under an organization as per…
3
votes
2 answers

How to do auto script generation with AWS glue job with AWS java SDK

I am creating glue job creation using Java Sdk. It has only two required params Command and Glue version. But i need to create job with auto script generation. As we can do from console, we add data source, A proposed script generated by AWS Glue,…
3
votes
0 answers

Service: AmazonSQS; Status Code: 403; Error Code: SignatureDoesNotMatch; SQS

i am running my simple class on ec2 to create or send messages on SQS. But this giving me Service: AmazonSQS; Status Code: 403; Error Code: SignatureDoesNotMatch; i'm attaching my code and the error below:- private AWSSimpleQueueServiceUtil() { …
3
votes
1 answer

How to build Amazon S3 Presigned PostPolicy for file uploading in Java SDK 2.0?

I need to generate an AWS Signature v4 signature for uploading to s3, like this: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html. I tried a lot of examples, but have the error InvalidAccessKeyId
Denis
  • 3,376
  • 10
  • 46
  • 68
2
votes
1 answer

DynamoDB Enhanced - No result from query

I have below two test cases implemented to test DynamoDB enhanced library. Test case 1: Use Get Item on table "digital_form", with PK = "FORM#ABC123" and SK = "INFO#ABC123". which can return result @Test public void testGetItemWithPKSK()…
2
votes
1 answer

Mocking aws-sdk-java 2.0

I'm trying to test my AWS Lambda function but I can't figure out how to mock the 2.0 SDK with Mockito. Basically, all I want is to create a couple DBSnapshot mocks and set a bit of test information on them (snapshot name and creation time would be…
Rome_Leader
  • 2,094
  • 9
  • 37
  • 63
2
votes
1 answer

How long is the connection to AWS using their Java SDK?

We are using AWSLambdaAsync.invoke() to run Lambda in AWS. Do the connection stays up until the execute is finished? Thanks in advance (-:
2
votes
1 answer

java code to create aws client using ec2 role or default credentials chain?

Below code creates AWS Credentials where access and secret keys are explicitly supplied. AWSCredentials credentials = new BasicAWSCredentials( "", "" ); But the issue with this approach is in production I can not…
2
votes
2 answers

deleteObjects using AWS SDK V2?

I'm trying to migrate from AWS SDK V1.x to V2.2. I can't figure out the deleteObjects method though. I've found a bunch of examples - all the same one :-( that doesn't appear to ever use the list of objects to delete (i.e. the list is present, but…
Todd
  • 2,500
  • 4
  • 28
  • 46
1
vote
1 answer

What is the difference between DynamoDBMapper and Table for DynamoDB Tables

In AWS DynamoDB, There are two options available to do the CRUD operations on the Table. DynamoDBMapper : com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;. AmazonDynamoDB dbClient =…
1
2 3 4 5