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.

preguntada hace un mes325 visualizaciones
3 Respuestas
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 hace un mes
profile picture
EXPERTO
revisado hace un mes
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
EXPERTO
respondido hace un mes
profile picture
EXPERTO
revisado hace un mes
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 hace un mes

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas