-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
60 lines (55 loc) · 1.38 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
50
51
52
53
54
55
56
57
58
59
60
service: lmbd-onoff-rds
frameworkVersion: '2'
provider:
name: aws
runtime: python2.7
region: us-east-1
environment:
RDS_REGION: us-east-1
TAG_KEY: Environment
TAG_VALUES: Testing,Staging
functions:
rds-on:
handler: lambda_function.lambda_handler
role: myCustRole
events:
- schedule: cron(0 8 ? * MON-FRI *)
environment:
CMD: START
rds-off:
handler: lambda_function.lambda_handler
role: myCustRole
events:
- schedule: cron(0 19 ? * MON-FRI *)
environment:
CMD: STOP
resources:
Resources:
myCustRole:
Type: AWS::IAM::Role
Properties:
Path: /
RoleName: lmbd-rds-onoff-role
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: lmbd-rds-onoff-policy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: "*"
- Effect: Allow
Action:
- rds:*
Resource: "*"