Questions tagged [aws-java-sdk]

0

votes
0

answer
5

Views
1

votes
2

answer
574

Views

Add trigger to AWS Lambda Function using Java API

How can I add new trigger for existing AWS Lambda function using Java API? I would like to add CloudWatch Events - Schedule trigger. It looks like I should use AmazonCloudWatchEventsClient. How can I set the credentials for the client? Any examples will be appreciated. Thanks.
Alex Broitman
1

votes
0

answer
418

Views

java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.partitions.PartitionsLoader

i alway get the error : [2018-02-05T09:04:14.682+0000] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=26 _ThreadName=http-listener-1(1)] [timeMillis: 1517821454682] [levelValue: 900] [[ StandardWrapperValve[AddToOrderServlet]: Servlet.service() for servlet AddToOrderServlet thre...
edenPan
1

votes
0

answer
196

Views

AWS Java SDK STS in Lambda timeout

I want to get temporary credentials via AWS Security Token Service in Lambda, but it is timeout at AWSSecurityTokenServiceClientBuilder.standard().build() all the time. Does anyone help me? Source Code: package example; import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.servi...
Xylem Yang
1

votes
0

answer
153

Views

AWS Lambda Java SDK Connect Timeout Issues

I have a java program that I want to invoke an AWS Lambda: String database = 'database-name'; String name = 'table-name'; String lambdaName = 'hive-nebula-directory-lambda-qa'; DefaultAWSCredentialsProviderChain defaultProvider = new DefaultAWSCredentialsProviderChain(); AWSCredentials defaultCreds...
KBouldin9
1

votes
1

answer
121

Views

How perform “cloudformation package” command via java sdk?

Here is package command description for cli. Can this command be executed via java sdk?
Cherry
1

votes
2

answer
139

Views

AWS IoT certificates per device or per group of devices?

I do have a question about the best practice for AWS IoT devices, should I create a certificate per device or should I use one certificate for multiple devices or per device type? I'm trying to find the best practice but I still not getting any information about it.
Rogelio Blanco
1

votes
0

answer
297

Views

com.amazonaws.SdkClientException: Unable to calculate MD5 hash: /home/bharath/Documents/demo/demo.txt (No such file or directory)

By taking the reference of this Question link below How to solve 'Client is immutable when created with the builder'? I do have a similar code structure wherein which am getting an error saying Unable to calculate MD5 hash public class LambdaFunctionS3 implements RequestHandler { @Override public S...
unknown
1

votes
1

answer
128

Views

how to get the current volume size attached to aws ec2 instance through java sdk

I have attached EBS volumes to my AWS ec2-instance but to fetch the current size of the AWS ec2 instance utilized I have to ssh and put command df -hT /dev/xvda1, and I get the value that 7% is occupied with full details but I want to get this value through my java code so how can I get this ? I am...
Vatsal Rahul
1

votes
0

answer
128

Views

How to forward the stream from AWS lambda stream output

I can find lots of information on writing directly to the output stream from an AWS Lambda function written in Java, but I can't find any information on how to get that stream in the Java AWS Lambda SDK so that I can bind the resulting inputstream to the outputstream within our API (the client of th...
Richtopia
1

votes
1

answer
98

Views

Execute A set of queries as Batch In AW Athena

I'm trying to execute AWS Athena queries as batch using aws-java-sdk-athena. I'm able to establish the connection,run individually the queries, but no idea how to run 3 queries as batch. Any help appreciated. Query 1.select * from table1 limit 2 2.select * from table2 limit 2 3.select * from table3...
Juhan
1

votes
0

answer
44

Views

error with aws-java-sdk-s3 when passing my jar with spark-submit

I am running a Spark job locally. In my code, I am creating an AmazonS3 client. I am using a recent version of aws-java-sdk and spark. When I package my code with its dependencies and pass it to Spark submit utility, I get the following error. Exception in thread 'main' java.lang.NoSuchMethodError:...
Surabhi Dixit
1

votes
1

answer
31

Views

How to build Amazon S3 Presigned PostPolicy for file uploading in Java SDK 2.0?

I need to generate an AWS Signature v4 signature for uploading to s3, like this: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html. I tried a lot of examples, but have the error InvalidAccessKeyId The AWS Access Key Id you provided does not exist in our records. ASIA2AKMADUN E...
Denis
1

votes
0

answer
47

Views

Service: AmazonSQS; Status Code: 403; Error Code: SignatureDoesNotMatch; SQS

i am running my simple class on ec2 to create or send messages on SQS. But this giving me Service: AmazonSQS; Status Code: 403; Error Code: SignatureDoesNotMatch; i'm attaching my code and the error below:- private AWSSimpleQueueServiceUtil() { try { this.simpleQueue = 'demo-Photo-Queue'; //this.s...
amit kumar
1

votes
0

answer
18

Views

Get an S3Object from a GetObjectResponse in AWS Java SDK 2.0

In AWS Java SDK 1.x, I could get an S3Object from an S3Client like this. S3Object obj = mS3Client.getObject(pBucket, pKey); I'm trying to replicate that functionality using AWS Java SDK 2.0 (and end up with an S3Object), but the closest I can get is a GetObjectResponse, and I can't find any simple m...
the_storyteller
1

votes
0

answer
73

Views

AWS Java SDK behind a corporate proxy

I want to test my AWS code locally so I have to set a proxy to a AWS client. There is a proxy host (http://[email protected]:my-corporate-proxy.com:8080) set in my environment via a variable HTTPS_PROXY. I didn't find a way how to set the proxy as whole so I came up with this code: AmazonSNS sns = AmazonSN...
Barney
1

votes
0

answer
20

Views

Is there a way to set the content type of Outputstream in AWS Lambda?

How can I use OutputStream to return content formatted as CSV? Something similar to this (except in Java/Scala): Response.ContentType = 'application/CSV'; The method signature for the lambda is: override def handleRequest(inputStream: InputStream, outputStream: OutputStream, context: Context): Unit...
covfefe
1

votes
0

answer
29

Views

Upload ZipOutputStream to S3 without saving zip file (large) temporary to disk using AWS S3 Java

I have a requirement to download photos (not in same directory) from S3, ZIP them and again upload to S3 using AWS S3 Java SDK. This zip file size can go in GBs. Currently I am using AWS Lambda which has a limitation of temporary storage up to 500 MB. So I don't want to save ZIP file on disk instead...
pankaj
0

votes
0

answer
6

Views

AWS Java SDK - using ProgressListener with TransferManager

I am looking at usage example provided in AWS SDK docs for TransferManager, in particular for the following code: TransferManager tx = new TransferManager(                credentialProviderChain.getCredentials()); Upload myUpload = tx.upload(myBucket, myFile.getName(), myFile);  // T...
michaJlS
0

votes
0

answer
6

Views

AWS Java SDK - Timeout waiting for connection from pool

I am working with AmazonSQS. I am using threads to read content from there, after a short time, I get the following error com.amazonaws.SdkClientException: Unable to execute HTTP request: Timeout waiting for connection from pool As I know the default connection pool size is 50. I do not have >50 thr...
javagc
1

votes
1

answer
131

Views

AWS SNS subsription to lambda doesn't automatically create event source using Java APIs

Below are the steps to reproduce using AWS Java API: 1. Create a Nodejs Lambda function 2. Create an SNS topic 3. Subscribe the SNS topic to the lambda function created using it's ARN Now if we go to the Lambda function and look at the Event Sources tab, we don't see SNS topic listed as an event sou...
infinity
1

votes
1

answer
518

Views

How to determine the number of nodes in a Redshift cluster?

I need to programmatically determine the number of nodes in a Redshift cluster. I was hoping the AWS Java APIs would provide it in a cluster description, but I am not able to locate it. Can anyone point me in the right direction?
Stephen McKain
1

votes
1

answer
409

Views

Scheduled Lambda to trigger from Aws Java Sdk

I would like to schedule the trigger of Lambda from Aws Java Sdk, the schedule could be more than a year from now, so SQS might not be an option. Is this possible? I cannot find any example in the web and in their sdk documentation.
richersoon
1

votes
1

answer
294

Views

writeTo PipedOutputStream just hangs

My goal is to: reading a file from S3, changing its metadata Push it out to S3 again AWS java SDK doesn't allow outputstreams to be pushed. Therefore, I have to convert the outputstream from step2 to inputstream. For this I decided to use PipedInputStream. However, my code just hangs in the write...
Omnipresent
1

votes
1

answer
483

Views

What's a good practice for dealing with DynamoDB batchGetItem's unprocessedKeys

We started using DynamoDB in the past few weeks in our project, both as a cache and as a list of events that occurred in the system (please let's not get into why there are better alternatives to implement this, I've argued that myself before DynamoDB was chosen with no result). It seems that becaus...
redwulf
1

votes
1

answer
659

Views

AWSMarketplaceMeteringClientBuilder.withRegion() is not visible

I am using AWS SDK for Java to use in AWS Metering service. When I tried to use AWSMarketplaceMeteringClientBuilder to create a AWSMarketplaceMeteringClient, I found that if I use withRegion(Region region) method, I get following compile time error: The method withRegion(Region) from the type AwsCli...
Rajib Biswas
1

votes
1

answer
380

Views

Error “Aws-sdk-java” conflict with maven

I am having conflict problem using aws-sdk-java and I no longer know what to do. I already tried several things and I researched several topics and I can not solve. java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.enable (Lcom / fasterxml / jackson / core / JsonParser $ Featu...
mPissolato
1

votes
1

answer
838

Views

AWS S3 Bucket policy public. How to make object private?

I've a bucket with GetObject available to everyone on full bucket(*). I want to make a few objects private(through Object level operation ACL), i.e. only the bucket owner should have read access to the object. I've gone through all available documentation, but couldn't find any possible way. Can any...
user3275863
1

votes
2

answer
0

Views

AWS Java SDK Version For Creating a Lambda

I'm trying to develop a AWS Java lambda function by following the guidance described here. In it it describes the implementation of the RequestHandler interface and also references the aws-lambda-java-core library. However I am trying to use the latest SDK as recommended here but this is completely...
Kerry
1

votes
1

answer
0

Views

How to set custom access logging configuration for AWS API Gateway via java sdk?

I want to set AWS API Gateway Rest Api Stage logging settings (see screenshot below) via aws java sdk. Now I create the deployment via CreateDeploymentRequest, which doesn't expose any such configuration. The same can be said about CreateStageRequest. UpdateStageRequest seems to provide a generic wa...
Pavel
1

votes
1

answer
0

Views

DynamoDB sort order of Date RangeKey

I have a DynamoDB table with the following key values: A simple string id as HashKey and a string representing a Date as RangeKey. The date string is in YYYY-MM-DD format. I am now wondering how DynamoDB orders its entries. When I query for multiple RangeKey values on the same HashKey the result is...
JohnnyKonfetti
1

votes
2

answer
0

Views

get data by non primary key with java Dynamodb

I just started using DyanamoDB in AWS. I am using java to implement lambda functions. I want way to get the data from a table which is equivalent to below SQL. SELECT * FROM UserTable U WHERE U.email='[email protected]' AND U.name LIKE 'Ste%'; where either one from email and name is not primary key...
bula
1

votes
1

answer
376

Views

Feeding SQS Queues available in two different AWS Accounts

For putting messages to SQS Queues and getting a connection, we need to have a key for the account/user. I want to feed messages to two queues which are available in two different AWS Accounts. How can I achieve that? As far as my understanding is, we can setup only one access/key credentials hence...
Bhaskar
1

votes
2

answer
1k

Views

AWS S3 get keys containing text

I'm trying to fetch the files from S3. As usual, my files are organised in the bucket as below: bucket//files I want to retrieve files having specific file names E.g.: Files starting with a given text (myfile-*) Files having specific extensions (*.csv) File names having specific text (text) For the...
Sunil Kumar B M
1

votes
2

answer
332

Views

Explicitly expire tokens acquired from AWS Security Token Service

Can I explicitly expire session tokens acquired from AWS STS service using AWS Java SDK?
Anirudh Jayakumar
1

votes
1

answer
444

Views

SQS visibility timeout locks out the entire queue, instead of just that particular message

I'm busy experimenting with SQS. From my understanding, a visibility timeout makes a message unavailable to other consumers for the length of that visibility timeout. From my experience, though, this appears to not be the case. It appears that a visibility timeout makes all messages in that queue un...
orrymr
1

votes
2

answer
783

Views

Invoke AWS Lambda with AWS API Gateway

I'm moving some scala code to AWS Lambda and I intend to have it exposed via AWS API Gateway, but I've been struggling to make the whole thing work as soon as I have one parameter. My (very simple) code looks like this: class HelloService { def hello(name: String) = { 'hello there, ' + name } } I up...
redwulf
1

votes
1

answer
154

Views

Access results of AWS Transcribe job with Java SDK

I have a AWS Transcribe job that gives me a URI when completed. This URI should be where the transcription text is stored. I want to access that text with the Java SDK, but GetObject does not seem to support this option. How do I access the text from the Transcribe job? // I am given this String URI...
1

votes
1

answer
288

Views

AWS Polly Java example

I am trying to execute a simple Java example of AWS Polly service, I am using the code provided by AWS on their documentation, I created a simple Maven Project using the following - 1. group id - com.amazonaws.polly 2. artifact id - java-demo 3. version - 0.0.1-SNAPSHOT Following is my project struc...
Aniruddha Raje
1

votes
2

answer
46

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 objects to delete (i.e. the list is present, but never set in the DeleteObjectsRequest object - I a...
Todd

View additional questions