Skip to content

Instantly share code, notes, and snippets.

@richardgrantserverless
Created May 23, 2022 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardgrantserverless/84a8fba2b74debc960acf7840b70ba72 to your computer and use it in GitHub Desktop.
Save richardgrantserverless/84a8fba2b74debc960acf7840b70ba72 to your computer and use it in GitHub Desktop.
functions:
takeScreenshot:
handler: handler.take_screenshot
timeout: 15 # our screenshots can take a while sometimes
events:
- http:
path: screenshots
method: post
# Marking the function as private will require a valid api-key
private: true
request:
# we want to mark the url param as required
parameters:
querystrings:
url: true
listScreenshots:
handler: handler.list_screenshots
timeout: 15
events:
- http:
path: screenshots
method: get
private: true
request:
parameters:
querystrings:
url: true
createThumbnails:
handler: handler.create_thumbnails
events:
# this event type will also create the screenshots bucket and trigger
# the lambda function every time a file is uploaded (ObjectCreated)
- s3:
bucket: ${self:custom.bucket_name}
event: s3:ObjectCreated:*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment