项目作者: Craftware

项目描述 :
Function for AWS Lambda to extract zip files uploaded to S3
高级语言: Java
项目地址: git://github.com/Craftware/aws-lambda-unzip.git
创建时间: 2015-10-09T20:05:03Z
项目社区:https://github.com/Craftware/aws-lambda-unzip

开源协议:Apache License 2.0

下载


aws-lambda-unzip

This code is very out of date, use at your own risk

Java 8 Function for AWS Lambda to extract zip files uploaded to S3

Files are extracted in place in the same bucket as where the zip file was uploaded. Any files present with the same name are overwritten. The zip file is deleted at the end of the operation.

Necessary permissions

In order to remove the uploaded zip file, the role configured in your Lambda function should have a policy looking like this:

  1. {
  2. "Effect": "Allow",
  3. "Action": [
  4. "s3:GetObject",
  5. "s3:PutObject",
  6. "s3:DeleteObject"
  7. ],
  8. "Resource": [
  9. "arn:aws:s3:::mybucket"
  10. ]
  11. }

Handler Configuration

Handler property should be configured to kornell.S3EventProcessorUnzip::handleRequest

Packaging for deployment

Maven is already configured to package the .jar file correctly for deployment into Lambda. Just run

  1. mvn clean package

The packaged file will be present in your target/ folder.