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.

已提问 1 个月前326 查看次数
3 回答
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
已回答 1 个月前
profile picture
专家
已审核 1 个月前
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
专家
已回答 1 个月前
profile picture
专家
已审核 1 个月前
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
已回答 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则