Skip to content

Instantly share code, notes, and snippets.

@mindlapse mindlapse/serverless.yml
Last active Aug 19, 2019

Embed
What would you like to do?
service: sleepmode # NOTE: update this with your service name
provider:
name: aws
runtime: nodejs10.x
iamRoleStatements:
- Effect: "Allow"
Action:
- "ec2:DescribeInstances"
- "ec2:DescribeInstanceStatus"
- "ec2:StopInstances"
- "sns:Publish"
Resource: "*"
environment:
TAG: Sleepy
SNS_TOPIC_ARN: 'arn:aws:sns:us-east-1:1234567890123:sleepmode'
functions:
goodmorning:
handler: handler.goodmorning
events:
- schedule: cron(0 12 * * ? *)
goodnight:
handler: handler.goodnight
events:
- schedule: cron(0 22 * * ? *)
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.