-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
56 lines (51 loc) · 1.48 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
service: serverless
package:
individually: true
include:
- src/assets/**
plugins:
- serverless-plugin-typescript
- serverless-offline
custom:
env: ${file(./.env.${opt:stage, 'dev'}.json)}
provider:
name: aws
runtime: nodejs18.x
region: ap-northeast-2
stage: ${opt:stage, 'dev'}
vpc:
securityGroupIds:
- ${self:custom.env.SG_ID}
subnetIds:
- ${self:custom.env.SUBNET_ID}
timeout: 900
environment:
DB_HOST: ${self:custom.env.DB_HOST}
DB_PORT: ${self:custom.env.DB_PORT}
DB_USERNAME: ${self:custom.env.DB_USERNAME}
DB_PASSWORD: ${self:custom.env.DB_PASSWORD}
DB_DATABASE: ${self:custom.env.DB_DATABASE}
SLACK_WEBHOOK_URL: ${self:custom.env.SLACK_WEBHOOK_URL}
MAIL_HOST: ${self:custom.env.MAIL_HOST}
MAIL_PORT: ${self:custom.env.MAIL_PORT}
MAIL_AUTH_USER: ${self:custom.env.MAIL_AUTH_USER}
MAIL_AUTH_PASS: ${self:custom.env.MAIL_AUTH_PASS}
NODE_ENV: ${opt:stage, 'dev'}
functions:
collect-coupang:
handler: src/handler.collectCoupangHandler
events:
- schedule: cron(0 * * * ? *)
check-server-status:
handler: src/handler.checkServerStatusHandler
events:
- schedule: cron(*/5 * * * ? *)
send-deal-alert:
handler: src/handler.sendDealAlertHandler
events:
- schedule: cron(*/5 * * * ? *)
check-infrastructure:
handler: src/handler.checkInfrastructureHandler
events:
- sns:
arn: arn:aws:sns:ap-northeast-2:${self:custom.env.ACCOUNT_ID}:infrastructure