Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Emoticon Faceswap serverless.yml
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
You can’t perform that action at this time.