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 Respostas
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
respondido há um mês
profile picture
ESPECIALISTA
avaliado há um mês
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
ESPECIALISTA
respondido há um mês
profile picture
ESPECIALISTA
avaliado há um mês
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
respondido há um mês

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas