Last active
August 19, 2019 01:52
-
-
Save mindlapse/dd3d83e281d67bb83382dd739d3c0a9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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