Skip to content

Instantly share code, notes, and snippets.

@pandaedward
Created October 2, 2019 02:16
Show Gist options
  • Select an option

  • Save pandaedward/3ba60beb5686d84073199001d117112c to your computer and use it in GitHub Desktop.

Select an option

Save pandaedward/3ba60beb5686d84073199001d117112c to your computer and use it in GitHub Desktop.
severless lambda python
service: schedule-stop-py
frameworkVersion: ">=1.2.0"
provider:
name: aws
runtime: python3.7
stage: ${opt:stage, 'develop'}
profile: <YOUR_AWS_PROFILE_NAME>
region: <YOUR_AWS_REGION>
functions:
schedule:
handler: lambda_function.run
name: schedule-stop-py-${self:provider.stage}
description: Lambda in Python to stop instances
timeout: 60
memorySize: 128
role: '<YOUR_AWS_IAM_ROLE_AS_EXECUTION_ROLE>'
tags:
env: ${self:provider.stage}
app: schedule-stop-py-${self:provider.stage}
events:
- schedule: cron(0 5 * * ? *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment