forked from davidgf/serverless-plugin-canary-deployments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
103 lines (99 loc) · 2.26 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
service: canary-deployments-test
provider:
name: aws
runtime: nodejs10.x
iamRoleStatements:
- Effect: Allow
Action:
- codedeploy:*
Resource:
- "*"
plugins:
- serverless-plugin-aws-alerts
- serverless-plugin-canary-deployments
custom:
alerts:
dashboards: false
deploymentSettings:
stages:
- dev
- prod
functions:
authorize:
handler: handler.authorize
deploymentSettings:
type: Linear10PercentEvery1Minute
alias: Live
hello:
handler: handler.hello
events:
- websocket:
route: $default
authorizer: authorize
- http: GET hello
- stream:
type: dynamodb
arn:
Fn::GetAtt:
- StreamsTestTable
- StreamArn
- sns: snsTopic
- sns:
topicName: fooTopic
displayName: fooTopic
filterPolicy:
eventType:
- FooEvent
- schedule:
rate: rate(1 minute)
enabled: false
- cloudwatchLog: "/aws/lambda/sls-wshop-dev-hello"
- sqs:
arn:
Fn::GetAtt:
- MyQueue
- Arn
- iot:
sql: "SELECT * FROM 'some_topic'"
alarms:
- name: foo
namespace: 'AWS/Lambda'
metric: Errors
threshold: 1
statistic: Minimum
period: 60
evaluationPeriods: 1
comparisonOperator: GreaterThanOrEqualToThreshold
deploymentSettings:
type: Linear10PercentEvery1Minute
alias: Live
preTrafficHook: preHook
postTrafficHook: postHook
alarms:
- HelloFooAlarm
preHook:
handler: hooks.pre
postHook:
handler: hooks.post
resources:
Resources:
StreamsTestTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: StreamsTestTable
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
StreamSpecification:
StreamViewType: NEW_AND_OLD_IMAGES
MyQueue:
Type: AWS::SQS::Queue
Properties:
DelaySeconds: 0
VisibilityTimeout: 120