144 questions
1
vote
0
answers
65
views
Migrate connection settings in S3 SDK v2
I have this AWS Java V1 client configurations:
ClientConfiguration cc = new ClientConfiguration();
cc.setConnectionMaxIdleMillis(10000);
cc.setUseTcpKeepAlive(true);
cc....
0
votes
1
answer
193
views
S3AsyncClient (AWS SDK v2, Java) uploads 0 bytes despite non-empty content
S3AsyncUploadService.java
package com.util.s3;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;
import software.amazon.awssdk.core.async.AsyncRequestBody;
import ...
0
votes
0
answers
84
views
Can't authenticate through SSO with Java AWS SDK
This is the actual error I'm getting:
software.amazon.awssdk.core.exception.SdkClientException:
Unable to load credentials from any of the providers in the chain:
AwsCredentialsProviderChain:
[
...
0
votes
0
answers
66
views
How to configure Java application to use LocalStack?
I have a Java application, which uses AWS SDK Java 2.31.12 to list objects in a S3 bucket. I setup LocalStack, but I can't configure my Java application to use LocalStack instead of AWS.
Profile
I ...
0
votes
1
answer
198
views
Aws SSO credential provider auto refresh token SDK of JAVA2 not work
I meet a problem and can't sovle it even though i search in AWS docs.
I got doc from this link:
https://docs.aws.amazon.com/sdkref/latest/guide/understanding-sso.html
https://docs.aws.amazon.com/...
0
votes
1
answer
75
views
AWS Java SDK v2.0: How to handle providing indexNames at runtime rather than using annotation
I have a project using DynamoDB which I'm upgrading to Java SDK v2.0
Using the new enhanced client and type mapping.
I have an index name which I need to pass to @DynamoDbSecondaryPartitionKey,
...
0
votes
1
answer
166
views
AWS Credentials not loading for one user in Java
Our team has created a Java command-line utility that connects to AWS S3. We aren't specifying a particular credentials source, we're just using S3Client.builder().region(region).build() and allowing ...
0
votes
1
answer
72
views
Non-ascii email address with Java & AWS SES
I'm using AWS SES to send emails from a Java application using AWS SDK v2.
ASCII email addresses work fine ([email protected]), but when I try to send email to address with non-ascii characters (...
1
vote
1
answer
776
views
Drop checksum header on AWS Java SDK 2 >= 2.30.0
We are having this issue where since some recent update the AWS SDK for Java always sends a x-amz-content-sha256 hash header in S3 putObject requests.
That works fine with AWS but our allegedly ...
2
votes
2
answers
165
views
What's the cost effective way to retrieve batch DDB Items by LSI sort keys?
I have a DDB table with the following structure:
CustmerID (PK)
emailId (SortKey)
orderId (LSI)
I want to get batch items using AWS DynamoDB Java SDK for the following 2 patterns:
Get Items by a PK ...
1
vote
0
answers
101
views
how to set JVM options for AWS Secrets manager via service specific endpoint override
I have a requirement where I need to override AWS secrets manager via my local endpoint to use localstack based secrets manager.
I was able to use AWS_ENDPOINT_URL_SECRETS_MANAGER and that works but I ...
0
votes
0
answers
72
views
AWS SQS error : The security token included in the request is expired
AWS sqs config class for aws sqs connection
@Configuration
@EnableSqs
public class AwsSqsConfig {
@Bean
public SimpleMessageListenerContainerFactory ...
2
votes
2
answers
1k
views
How to programmatically create IAM Roles Anywhere sessions with AWS SDK for Java V2 in a Spring Boot service
I'm working on a Spring Boot backend service where I need to access certain S3 buckets programmatically using IAM Roles Anywhere. I found the following documentation for RolesAnywhereClient in the AWS ...
0
votes
1
answer
909
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
697
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 ...
0
votes
1
answer
389
views
Issues with Region in S3AsyncClient and S3TransferManager using Minio with AWS SDK for Java
I encountered an issue while configuring S3AsyncClient using the AWS SDK for Java in a Spring Boot application. Despite setting all the necessary properties, I keep receiving the following error ...
1
vote
1
answer
45
views
Getting a number of items from a list by pagination in Dynamodb
I have a dynamodb structure like below:
{
"PK" : "queue#1234#view",
"SK" : "board#1234",
"items" : [
"1234&...
2
votes
1
answer
523
views
Cannot find symbol class ResponseHeaderOverrides location: package software.amazon.awssdk.services.s3.model Java SDK v2 AWS
I am a beginner to Java programming.
I am trying to do a GET on a object in S3 using the AWS Java SDK v2. The code is staightforward hello world code that I have from a video tutorial.
//get ...
1
vote
1
answer
1k
views
DynamoDB java sdk v2 client batchWrite retries
Does the DynamoDB Java SDKv2 offer a retry strategy for batchWriteItem calls? I'm looking for a retry strategy that retries items that would otherwise be returned as unprocessedItems.
In the DynamoDB ...
1
vote
2
answers
241
views
Is there an equivalent of the socketTimeout configuration option for the AwsCrtHttpClient?
In the AWS Java SDKv2, the ApacheHttpClient and UrlConnectionHttpClient both have a socketTimeout configuration option:
socketTimeout(Duration socketTimeout)
The amount of time to wait for data to be ...
2
votes
0
answers
638
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 ...
0
votes
1
answer
101
views
Fetch records from DynamoDb db table
I have a Dynamodb records example
{
"cDate":"2024-03-04",
"myList":[
{
"M" : {
"rt":{"N":"1.06"},
...
0
votes
1
answer
347
views
AWS S3 Java 2.X Create Bucket Issue
Create bucket is failing with software.amazon.awssdk.services.s3.model.S3Exception: An error occurred when parsing the HTTP request PUT at '/' (Service: S3, Status Code: 400, Request ID: )
S3Client ...
0
votes
1
answer
726
views
AWS S3 Java 2.X Client configuration issue
StaticCredentialsProvider provider = StaticCredentialsProvider.create(AwsBasicCredentials.create("Access key ID", "Access secret key"));
S3Client s3 = S3Client.builder()....
0
votes
1
answer
207
views
Stream a large SQL ResultSet directly to an S3 bucket in java
I have a (possibly) quite large ResultSet when querying a (Vertica) SQL Database, and because it won't fit in memory I'm trying to find a way to stream the results (in CSV form) directly to an S3 ...
1
vote
0
answers
300
views
aws java sdk ProfileCredentialsProvider without region
AWS S3Client is throwing exception when try to use ProfileCredentialsProvider without region. I've a credentials file that does not have region name but I'm overriding endpoint in the code. I can't ...
1
vote
1
answer
756
views
Why do I get a 403 error when connecting to an AWS API Gateway websocket API using the AWS SDK?
I’m currently developing a Spring application and have encountered an issue while trying to post a message to a Websocket connection.
I’ve successfully set up a Websocket API in AWS API Gateway and ...
0
votes
1
answer
153
views
AWS SDK Java Tagging Run Instances
Our AWS team enabled tags in INSTANCE and VOLUME and now we have to modify our codes to add tagging. I tried to tag an EC2 instance but I got the following error below and hopefully someone can point ...
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 ...
0
votes
1
answer
657
views
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, ...
0
votes
1
answer
602
views
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 ...
1
vote
1
answer
73
views
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 ...
0
votes
2
answers
2k
views
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 ...
0
votes
1
answer
3k
views
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 ...
2
votes
2
answers
6k
views
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 ...
2
votes
1
answer
1k
views
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 ...
0
votes
1
answer
418
views
AWS Java 2.x TransferManager How to get TransferState in TransferListener?
In the new AWS Java SDK v2 TransferManager how do I get the equivalent of com.amazonaws.services.s3.transfer.TransferState in the v1 TransferManager?
I assume it's using a TransferListener and the ...
0
votes
0
answers
131
views
Set "Description" in RestoreRequest for S3 object retrieval from GDA to Standard storage using AWS Java SDK v2
Creating an Object Restore request from AWS S3 Glacier Deep Archieve to AWS S3 standard storage using AWS Java SDK V2 with the following code. Which works successfully with these parameters specified ...
1
vote
0
answers
207
views
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 ...
0
votes
1
answer
780
views
AWS Java SDK DynamoDB, how to get attribute values from ExecuteStatementRequest response?
I'm using Java AWS SDK to query a DynamoDB table using ExecuteStatementRequest, but I'm don't know how to fetch the returned attribute values from the response.
Given I have the following query:
var ...
0
votes
1
answer
1k
views
How to escape reserved keywords in DynamoDB ExecuteStatementRequest?
I'm trying to issue an update ExecuteStatementRequest using DynamoDB and Java SDK 2.0. I'm struggling to escape keywords that are columns in my table schema.
The following statement:
var response = ...
0
votes
0
answers
735
views
Getting `S3Exception` when executing download operation with `S3TransferManager` AWS SDK 2.19
I am using the S3TransferManager with S3AsyncClient in my service code. I am testing this code with localstack docker S3 service. I have the local stack S3 service and created the bucket test and ...
0
votes
1
answer
850
views
How to fix JSON string uploading to S3 with contents of "[value: string]" rather than actual data
In Scala, I'm using the AWS Java SDK to upload a simple JSON string (containing a few rows of data from a database). The upload appears to work fine but the content of the uploaded file once it's in ...
0
votes
1
answer
1k
views
GROUP BY-Like query in DynamoDB with DynamoDbEnhancedClient
I'm trying to write a Query in DynamoDB with logic similar to a GROUP BY in SQL. Let's consider the following table with partition key simulation_id:
Simulation (Table):
simulation_id_1 - type_1 - ....
2
votes
0
answers
3k
views
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 ...
3
votes
1
answer
2k
views
Unable to execute HTTP request
I am trying to use java sdk to get list of aws ec2 instances and s3 bucketsattached to a user. My main program class is
`
package com.aws.demo;
import java.util.List;
import org.springframework.boot....
0
votes
1
answer
2k
views
AWS SDK2 java s3 select example - how to get result bytes
I am trying to use aws sdk2 java for s3 select operations but not able to get extract the final data. Looking for an example if someone has implemented it. I got some idea from [this post][1] but not ...
0
votes
0
answers
1k
views
AWS SQS Receive Message and Delete message with JAVA
I am doing some operations which will publish messages to an SQS, a standard SQS, not a FIFO one. After that I am trying to receive both the messages from SQS and delete both of them.
I have written ...
0
votes
0
answers
280
views
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 ...
0
votes
1
answer
849
views
Instrumenting AWS async client sdk threadpool with Micrometer
I'm trying to understand the best way to instrument the default thread pool executor used by AWS async client. Source. We are using Micrometer for tracking all metrics.
I aim to understand if I should ...