-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
46 lines (42 loc) · 1.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
service: zaptalk-invoice-microservice
plugins:
- serverless-pseudo-parameters
custom:
secrets: ${file(secrets.json)}
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: ${self:custom.secrets.aws.region}
memorySize: 128
tracing:
lambda: true
environment:
accountId: ${self:custom.secrets.aws.accountId}
region: ${self:custom.secrets.aws.region}
bucket: ${self:custom.secrets.aws.bucket}
snsTopicToListen: ${self:custom.secrets.aws.snsTopicToListen}
snsTopicErrorHandling: ${self:custom.secrets.aws.snsTopicErrorHandling}
notificationSNS: ${self:custom.secrets.aws.notificationSNS}
loggerSNS: ${self:custom.secrets.aws.loggerSNS}
iamRoleStatements:
- Effect: "Allow"
Resource: "*"
Action:
- "sns:*"
- Effect: Allow
Action:
- s3:PutObject
- s3:PutObjectAcl
- s3:GetObject
Resource: "arn:aws:s3:::${self:custom.secrets.aws.bucket}/*"
functions:
invoice:
handler: invoice.handle
events:
- sns: ${self:custom.secrets.aws.snsTopicToListen}
onError: arn:aws:sns:#{AWS::Region}:#{AWS::AccountId}:${self:custom.secrets.aws.snsTopicErrorHandling}
error:
handler: error.handle
events:
- sns: ${self:custom.secrets.aws.snsTopicErrorHandling}