-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
49 lines (45 loc) · 1.22 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
service: lambda-cp-asg
package:
exclude:
- node_modules/**
- README.md
- package.json
- package-lock.json
- yarn.lock
- buildspec.yml
- build.sh
- LICENSE
- examples/**
provider:
name: aws
runtime: python3.6
stage: ${opt:stage, 'dev'}
region: ap-southeast-1
iamRoleStatements:
- Effect: Allow
Action:
- autoscaling:UpdateAutoScalingGroup
Resource:
- "Fn::Join": ["" , ["arn:aws:autoscaling:" , {"Ref": "AWS::Region"}, ":", {"Ref": "AWS::AccountId"}, ":autoScalingGroup:*:autoScalingGroupName/*"]]
functions:
scale-asg:
handler: handler.scale
memorySize: 512
timeout: 5
events:
- schedule:
description: 'Scale-Up: Schedule at 9am GMT+8 Mon-Fri'
rate: cron(0 1 ? * MON-FRI *)
enabled: true
input:
AsgGroupName: sitapp-AutoScaleGrp-XL7APL96YQPQ
MinSize: 1
DesiredCapacity: 1
- schedule:
description: 'Scale-Down: Schedule at 7pm GMT+8 Mon-Fri'
rate: cron(0 11 ? * MON-FRI *)
enabled: true
input:
AsgGroupName: sitapp-AutoScaleGrp-XL7APL96YQPQ
MinSize: 0
DesiredCapacity: 0