-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
42 lines (38 loc) · 924 Bytes
/
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
service: micropost
provider:
name: aws
runtime: nodejs4.3
region: ap-northeast-1
stage: ${opt:stage, self:custom.defaultStage}
iamRoleStatements:
- Effect: "Allow"
Action:
- "ecr:DescribeImages"
- "ecr:BatchDeleteImage"
Resource: "*"
functions:
notifyToSlack:
handler: functions/notify_to_slack.handle
events:
- sns: web_autoscaled
cleanEcrImages:
handler: functions/clean_ecr_images.handle
events:
- schedule:
rate: rate(24 hours)
enabled: true
input:
age: 2
repositoryName: 'micropost/frontend'
- schedule:
rate: rate(24 hours)
enabled: true
input:
age: 2
repositoryName: 'micropost/backend'
custom:
defaultStage: stg
writeEnvVars:
SLACK_WEBHOOK_URL: ${env:SLACK_WEBHOOK_URL}
plugins:
- serverless-plugin-write-env-vars