-
Notifications
You must be signed in to change notification settings - Fork 4
/
serverless.yml
96 lines (90 loc) · 2.9 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
plugins:
- serverless-python-requirements
- serverless-prune-plugin
service: notification-service
provider:
name: aws
runtime: python3.7
memorySize: 512
timeout: 30
region: ${file(./config.${self:provider.stage}.json):REGION}
stage: ${opt:stage,'development'}
deploymentBucket:
name: snet-serverless-artifacts # Deployment bucket name. Default is generated by the framework
serverSideEncryption: AES256 # when using server-side encryption
tags:
key1: notification
key2: email
deploymentPrefix: serverless
tracing: true
custom:
pythonRequirements:
fileName: requirement.txt
dockerizePip: true
useDownloadCache: true
useStaticCache: true
cacheLocation: "/var/cache/serverless"
prune:
automatic: true
includeLayers: true
number: 3
package:
exclude:
- .circleci/**
- .gitignore/**
- .serverless/**
- requirement.txt
- config.development.json
- serverless.yml
- README.md
- package.json
- License
functions:
send-notification:
handler: application/handler.send_notification
role: ${file(./config.${self:provider.stage}.json):ROLE}
vpc:
securityGroupIds:
- ${file(./config.${self:provider.stage}.json):SG1}
- ${file(./config.${self:provider.stage}.json):SG2}
subnetIds:
- ${file(./config.${self:provider.stage}.json):VPC1}
- ${file(./config.${self:provider.stage}.json):VPC2}
process-user-message:
handler: application/handler.process_user_message
role: ${file(./config.${self:provider.stage}.json):ROLE}
vpc:
securityGroupIds:
- ${file(./config.${self:provider.stage}.json):SG1}
- ${file(./config.${self:provider.stage}.json):SG2}
subnetIds:
- ${file(./config.${self:provider.stage}.json):VPC1}
- ${file(./config.${self:provider.stage}.json):VPC2}
events:
- http:
method: POST
path: /user/message
cors:
origin: ${file(./config.${self:provider.stage}.json):ORIGIN}
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
- x-requested-with
send_notification_alert:
handler: application/handlers/alert_handlers.send_notification_alert
role: ${file(./config.${self:provider.stage}.json):ROLE}
vpc:
securityGroupIds:
- ${file(./config.${self:provider.stage}.json):SG1}
- ${file(./config.${self:provider.stage}.json):SG2}
subnetIds:
- ${file(./config.${self:provider.stage}.json):VPC1}
- ${file(./config.${self:provider.stage}.json):VPC2}
description: Send Notification alerts
environment:
ENVIRONMENT: ${file(./config.${self:provider.stage}.json):ENVIRONMENT}
PAUSE_NOTIFICATION: ${file(./config.${self:provider.stage}.json):PAUSE_NOTIFICATION}