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

125 questions
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,518
  • 9
  • 42
  • 73
2
votes
0 answers

Overriding default SdkClientOption.SCHEDULED_EXECUTOR_SERVICE in AWS SDK for Java 2

Is there a way I can override the default SdkClientOption.SCHEDULED_EXECUTOR_SERVICE in AWS SDK for Java 2? I want to get rid of all the threadpools that are opaque to the application, and ensure that the threadpools are reused across all…
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

AWS JDK 2 create queue and subscribe to topic

I'm working on AWS with SNS / SQS, and i'm trying to create a SNS subscription on a SQS topic. I'm using AWS Java SDK 2. I can create the topics and the queues correctly, the problem i'm facing is im getting an error when creating the subscription…
elcharrua
  • 1,582
  • 6
  • 30
  • 50
2
votes
0 answers

Java AWS SDK V2 "getObject" track progress

I've written a code using Swing for a GUI interface and a Swingworker which handles download using a Sync client. this is what the doInBackground() method of the worker should to: 1)acknowledge a label with the current file to download 2)download…
edo1080
  • 61
  • 7
1
vote
1 answer

Programmatically Mapping AWS Resource Types to AWS Services

I would like to map AWS Resource Types to AWS Services programmatically when fetching AWS SecurityHub findings. For example, if an AWS SecurityHub finding indicates the affected resource with AwsS3Bucket, I would like to convert that to AWS S3 as…
1
vote
0 answers

How to ADD values in a map field in DynamoDB using UpdateItem operation?

I need to constantly increment values for a map field value in DynamoDB. The map will contain keys with counters, and for each update I want to atomically increment the keys. The corner case is that for this operation it needs to do an upsert,…
João Pedro Schmitt
  • 1,046
  • 1
  • 11
  • 25
1
vote
0 answers

Java AWS SDK v2 S3Client creation fail

I'm try to use S3Client from AWS Java SDK v2, on my JHipster Spring boot project. In addition to S3CLient i'm using S3Presigner for pre-signed url generation. This is the configuration class, that i'm using to create beans: @Configuration public…
1
vote
0 answers

AWS Java S3 Client read JSON file with double quotes

I'm trying to read a JSON file stored in an AWS S3 bucket, but when I try to parse the result with GSON I get the following error, since the result is returned with double quotes: "Expected BEGIN_OBJECT but was STRING at line 1 column 1" Is there a…
1
vote
1 answer

Network Load Balancer can not find in aws by Java SDK (v1 & v2)

I want to get list of NLB(Network-Load-balancer) in specific region by AWS Java SDK from AWS. Here is my sample Code: ElasticLoadBalancingClient loadBalancingClient = ElasticLoadBalancingClient.builder ().credentialsProvider ( …
1
vote
1 answer

Unable to Access IAM AWS Service Endpoint in a private subnet using a Private Link of VPC Endpoint

We're trying to access AWS Services from a private subnet in a VPC using a VPC endpoint or Private Link. We're trying to avoid adding a NAT gateway on the private subnet. We created/added a VPC Endpoints (i.e. AWS Service for EC2 and…
bherto39
  • 1,516
  • 3
  • 14
  • 29
1
vote
2 answers

AWS SDK for Java v2 is unable to load credentials from EC2 instance

I inserted my AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in ~/.aws/credentials and they seem to work. However, my java application (running on that EC2 instance and using AWS Java v2 SDK) is unable to see them. I got this exception while uploading…
1
vote
1 answer

How to get the status and progress of an AWS Elemental MediaConvert job in Java

I have converted a video using the AWS Elemental MediaConvert. The video is stored in S3. For this, I am submitting a job from the Java code and it is returning the jobID. I need to write a listener in my code, that listener should be notified when…
1
vote
0 answers

SES listContacts: The request signature we calculated does not match

I am using the Java SDK 2 (version 2.17.51), and when attempting a simple listContacts request, I get the following: software.amazon.awssdk.services.sesv2.model.SesV2Exception: The request signature we calculated does not match the signature you…
mitchus
  • 4,677
  • 3
  • 35
  • 70
1
vote
2 answers

AWS Java SDK v2: Upload a directory to S3

I would like to upload a directory to S3 using the AWS Java SDK v2. For example, how would I implement the following function? fun uploadDirectory(bucket: String, prefix: String, directory: Path) I would like the contents of directory to be…
1 2
3
8 9