AWS Lambda for uploading file to S3

0

Hi, is there any way possible for an AWS Lambda function written in Java to upload a file in different formats to an Amazon S3 bucket? The AWS Lambda function only takes JSON as input, so I am not seeing a way to do this unless the file is kept on some other type of storage in AWS. Then, I can just pass the filename as input to the Lambda function and the lambda function can get the file from this other type of storage and upload it to an S3 bucket. Any recommendation on what other type of storage I can use to get the file? Thanks a lot.

3 Answers
0

Hi, How are you receiving the files? Are these static files or files are changing?

Perhaps you could use ephemeral storage in lambda https://aws.amazon.com/blogs/aws/aws-lambda-now-supports-up-to-10-gb-ephemeral-storage/ This will allow you to save files in the lambda function in a directory called

/tmp

that you can access inside the lambda.

AWS
answered a month ago
profile picture
EXPERT
reviewed a month ago
0

I would go for having an API gateway where a lambda just would generate a signed url.

Then the client will PUT the file by using the url.

https://aws.amazon.com/blogs/compute/patterns-for-building-an-api-to-upload-files-to-amazon-s3/

profile picture
EXPERT
answered a month ago
profile picture
EXPERT
reviewed a month ago
0

You can insert any file format in to s3. If I understand your question correctly then you are trying to upload file received from another s3. In that case once object create you can get your lambda triggered read stream and write stream into another s3

Sushant
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions