R.B.
R.B.

Reputation: 537

Run shell command on AWS S3 file upload using AWS Lambda

My application involves creating a file in S3 bucket on every successful request completion. I want to run a shell script as soon as file is uploaded. Shell script can be something like mv file1 file2 (It won't be rename, I have something to do with zipping file and fixing it but it will be a shell command and nothing else like zip -FFv final.zip --out fixed.zip).

Is it possible through AWS-Lambda?

If Yes, will it involve copying file to some other location, perform the operation and upload back to S3 or it will be directly executed on S3 itself as My files are of large sizes (20 GB or so)

Upvotes: 0

Views: 974

Answers (1)

Jason Wadsworth
Jason Wadsworth

Reputation: 8887

It's really going to depend on what you want to do with the file. A large cannot really be processed with a Lambda function because of the memory and disk limitations in Lambda (512MB disk space and max of ~3GB memory). There are some S3 functions that can be done that don't require downloading the file. As for doing it as a shell command, it's doable, but not as easily as writing code (though PowerShell is natively supported).

Upvotes: 1

Related Questions