All Questions
Tagged with aws-java-sdk-2.x aws-sdk
15 questions
1
vote
1
answer
528
views
User is not authorized to perform: bedrock:CreateKnowledgeBase
I am trying to create a bedrock knowledgebase using aws sdk. but when i try to hit the createKnowledgeBase method if gives me the below error.
User: arn:aws:iam::85172538xxxx:user/bedrock_assist_user ...
0
votes
1
answer
493
views
How to set the request body for POST request using the AwsCrtHttpClient (AWS CRT HTTP Client?)
I am creating HTTP requests with the AWS CRT HTTP Client, but I cannot find a way to set the request body. I am using Java 11 with the AWS SDK version 2.27.9. No matter how I configure this ...
1
vote
0
answers
546
views
Unable to acquire further connections in AWS S3 Async client after failure
Using V2 of the Java AWS SDK, with V2 of the netty nio client, we hit a scenario where we DDOS our application and then get the error:
"Caused by: java.lang.Throwable: Acquire operation took ...
1
vote
0
answers
3k
views
AWS SDK for Java v2.0 - using S3 CRT Async Client, s3Client.putObject fails with InvalidStateException after 10 seconds of hanging
I'm using AWS SDK for Java v2.0, S3 Async Client with the aws-crt library, which allows to easily put objects with undetermined size as it uses multi-part transfer internally.
Occasionally it fails ...
11
votes
1
answer
4k
views
Unmarshalling DynamoDB Map<String, AttributeValue> to document-style JSON in AWS Java SDK 2.x
The answers to the question Converting DynamoDB JSON to Standard JSON with Java are obsolete in 2022.
The problem is that both of these imports no longer work:
import com.amazonaws.services.dynamodbv2....
3
votes
0
answers
1k
views
AWS SDK 2.x issues in PUTOBJECT request. Unable to add headers
We recently migrated from AWS SDK 1.x to 2.x for Java and put operation for AWS S3 is not happening. S3 bucket is encryption enabled ( using AWS KMS key).
Below is the code I am trying to use but I am ...
0
votes
1
answer
3k
views
Using DynamoDBEnhancedAsyncClient to scan and fetch futureObject
I am trying to use v2 library to persist & retrieve data in non-blocking manner.
Put method of DynamoDBEnhancedAsyncClient returns CompletableFuture object but scan and query methods return ...
2
votes
2
answers
7k
views
AWS SDK for Java S3 bucket Access Key Id issue
I am trying to access an Amazon S3 bucket programmatically through Java libraries. (to do basic cloud management from a third-party application). As a first step, I tried to print whether a bucket ...
1
vote
1
answer
137
views
GetCostAndUsageWithResources mehtod is not available in JAVA SDK
Here I used AWS java SDK for the programmatic access and when I try to call getCostAndUsageWithResources, it is not available. But in java documentation it is mentioned that ...
0
votes
1
answer
4k
views
AWS Java SDK isn't found at runtime
I am attempting to run boilerplate code with dynamo db. I am using maven shade and everything works fine at compile time, but I get java.lang.NoClassDefFoundError: software/amazon/awssdk/services/...
16
votes
2
answers
6k
views
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 ...
1
vote
1
answer
1k
views
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 ...
0
votes
1
answer
997
views
AWS API integration with Cloudwatch returning blank datapoints
I am currently trying to create a Java application that can call and reference the Amazon AWS API through the AWS Java SDK. I have been able to make calls directly to services like S3 and EC2 but when ...
0
votes
1
answer
443
views
How to detach an IAM role into AWS running instance and attach a new IAM role into that particular instance using java
I am creating an Amazon EC2 instance with a specific IAM Role.
Now I want to detach that IAM role and attach a new IAM Role or replace with a new IAM Role. I am finding the options to do with CLI but ...
9
votes
2
answers
7k
views
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 ...