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.

Revisions

  1. pandaedward created this gist Oct 2, 2019.
    24 changes: 24 additions & 0 deletions serverless.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    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 * * ? *)