Created
January 15, 2017 01:53
-
-
Save johncmckim/0539c731d874695c0e0ce9778d025470 to your computer and use it in GitHub Desktop.
Emoticon Faceswap serverless.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: serverless-emoticon-faceswap | |
provider: | |
name: aws | |
runtime: nodejs4.3 | |
# Allow Lambda to access Rekognition and S3 | |
iamRoleStatements: | |
- Effect: Allow | |
Action: | |
- rekognition:DetectFaces | |
Resource: '*' | |
- Effect: Allow | |
Action: | |
- s3:GetObject | |
- s3:PutObject | |
Resource: arn:aws:s3:::${self:custom.bucketName}/* | |
custom: | |
bucketName: ${self:service}-${opt:stage}-uploads | |
functions: | |
# Define my Lambda function | |
faceswap: | |
handler: src/faceswap.handler | |
timeout: 30 | |
environment: | |
BUCKET_NAME: ${self:custom.bucketName} | |
ALLOWED_EXTENSIONS: .jpg|.jpeg|.png | |
PROCESSED_DIR_NAME: processed | |
events: | |
# Create a S3 bucket that triggers my Lambda function | |
- s3: | |
bucket: ${self:custom.bucketName} | |
event: s3:ObjectCreated:* | |
rules: | |
- prefix: uploads/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment