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
1
vote
1 answer

Exception while reading RDS secrets from AWS secrets manager using aws-secretsmanager-jdbc

I am using AWS SDK for java on my project and now want to use the AWS secrets manager to store RDS details. while integrating aws-secretsmanager-jdbc, getting a below error while running a query against database: java.lang.NoSuchFieldError:…
Jainik
  • 2,352
  • 1
  • 19
  • 27
1
vote
2 answers

Specify credentials to AWS Cloudwatch logs Client

Hi I am trying to create a exception logs of my java application code in AWS cloudwatch for that I have used CloudWatchLogsClient to put my events to it but i am getting a below Error DEBUG…
1
vote
1 answer

while migrating the code from 1.11 to 2.x version , I am unable to find alternate for PEM in AWS java 2.x version

Could you please suggest alternate class for PEM to read private key. Code is as below: import com.amazonaws.auth.PEM; public PrivateKey getPrivateKey(String filename1) throws Exception { InputStream res= new…
preet kaur
  • 33
  • 3
1
vote
1 answer

How to get the cost of any EC2 instance using java-sdk

I want to get the usage and cost of my EC2 instances using the Cost Explorer API. I am able to get the usage and cost successfully but that cost and usage includes the amount of usage done by EC2 instance and EBS volumes, so I wanted to seperate the…
1
vote
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…
1
vote
1 answer

Generate Code (java, python, etc.) from CloudFormation Template

Is there a mechanism/framework available to generate code from a CloudFormation template?
1
vote
1 answer

Is there a method to add Target Group to LoadBalancer?

I'm trying to launch an application load balancer from java sdk. I noticed that I can add "Target Group" in "Step 4: Configure Routing" through the console but I don't know how to add a target group through code. There seems to be not function like…
0
votes
0 answers

Getting DeleteObjectsResponse for the objects that are not even created or present on the version enabled S3 bucket

I want to delete all the versions along with the delete marker for multiple objects from the version enabled S3 bucket with Java sdk 2.0. I'm trying below code to do that ArrayList keys = new ArrayList<>(); ObjectIdentifier…
Ssk
  • 13
  • 3
0
votes
1 answer

How to make SqsClient region agnostic

I see that in docs that for SqsClient, the region must be set in advance, making this client tied to a specific region only. my question is, is it possible to make SqsClient region agnostic, so, requests for different regions can be made using the…
0
votes
1 answer

DynamoDB Java SDK - QueryRequest with IN clause

The Javadoc of software.amazon.awssdk.services.dynamodb.model.QueryRequest.expressionAttributeValues() says a following query can be done: ProductStatus IN (:avail, :back, :disc) where the values are passed in in "ExpressionAttributeValues" as…
0
votes
1 answer

Is it possible to download invoices from AWS billing using the sdk-for-java and if so, how?

I've been looking at the documentation for the AWS SDK for Java and I'm trying to find how one can download the monthly invoices using this SDK. Is it at all possible or am I chasing my tail here? If this is not supported, are there any…
carlspring
  • 31,231
  • 29
  • 115
  • 197
0
votes
2 answers

Default behavior of AWS EventBridge put events with no bus name from Java SDK 2

I'm using the AWS Java SDK 2 with Java 17 on Windows 10. I have my AWS credentials configured correctly for the CLI/SDK/etc. On my local machine I'm testing sending an event to EventBridge. Using the EventBridge examples using SDK for Java 2.x I…
Garret Wilson
  • 18,219
  • 30
  • 144
  • 272
0
votes
1 answer

Optimal method to Long Poll/ Keep on retrieving new SQS messages

I have a Java Spring Boot app where I would like to listen to SQS messages as they come in. Ideally I want to do this in the most efficent manner possible. Currently the only solution I can see is to have a while loop the runs every few seconds and…
0
votes
1 answer

How do I use localstack with the aws java sdk?

I'm attempting to use localstack for development with SQS. Aws client v2.20.60 localstack v2.0.2. I'm following this blog post, but no matter what I try, I always get the error: exception while calling sqs with unknown operation: Operation…
Kevin
  • 1,080
  • 3
  • 15
  • 41
0
votes
1 answer

Kinesis: How to read data sequentially from an on-demand stream?

Following the examples given in the AWS Kinesis documentation, I am trying to produce and consume from a Kinesis on-demand stream. What I observed is, when we run the producer, it successfully produces 50 data into the stream. But, reading them…
Amudhan
  • 696
  • 8
  • 18
1 2 3
8 9