Skip to main content

All 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 ...
mohd sabahat's user avatar
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 ...
Flumenque's user avatar
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 ...
user3790053's user avatar
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 ...
Jonathan Gross's user avatar
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....
Alex R's user avatar
  • 11.9k
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 ...
Balaji's user avatar
  • 191
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 ...
Hrv's user avatar
  • 15
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 ...
Sachu's user avatar
  • 359
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 ...
Tech222's user avatar
  • 45
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/...
Jonathan Williamson's user avatar
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 ...
dutoitns's user avatar
  • 2,283
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 ...
Vatsal Rahul's user avatar
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 ...
WiscoRadio's user avatar
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 ...
Vatsal Rahul's user avatar
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 ...
Todd's user avatar
  • 3,019