Skip to content

Instantly share code, notes, and snippets.

@FBosler
Created December 5, 2021 20:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FBosler/4fb6821306a0f24a78fc1d354e5e59e1 to your computer and use it in GitHub Desktop.
Save FBosler/4fb6821306a0f24a78fc1d354e5e59e1 to your computer and use it in GitHub Desktop.
service: fb-notification-service # Name of the service
useDotenv: true # We want to get the env variables from our .env
provider:
name: aws # provider we want to use
runtime: python3.8 # runtime we want to use // python3.9 does not work currently
memorySize: 128 # memory size, 128 is the lowest, scales performance
region: eu-central-1
stage: ${opt:stage, 'production'} # is used in the name
lambdaHashingVersion: 20201221 # not stricly necessary, but helps identifying lamdas
environment: # here we need to make the .env variables available to our project
EMAIL: ${env:EMAIL}
EMAIL_PASSWORD: ${env:EMAIL_PASSWORD}
SMTP_SERVER: ${env:SMTP_SERVER}
TWILIO_NUMBER: ${env:TWILIO_NUMBER}
TWILIO_SID: ${env:TWILIO_SID}
TWILIO_AUTH: ${env:TWILIO_AUTH}
SLACK_WEBHOOK: ${env:SLACK_WEBHOOK}
# We need the following part to inject our python requirements
custom:
pythonRequirements:
dockerizePip: non-linux
plugins:
- serverless-python-requirements
# configures function execution
functions:
run: # name of the lambda function
handler: handler.run # function to be called ~ handler.py -> run()
events:
- schedule: rate(60 minutes) # frequency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment