-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
44 lines (38 loc) · 1.06 KB
/
Copy pathserverless.yml
File metadata and controls
44 lines (38 loc) · 1.06 KB
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
service: analytics-notifications-slack
provider:
name: aws
runtime: provided.al2023
architecture: arm64
timeout: 380
stage: ${opt:stage, self:custom.defaultStage}
region: ap-northeast-1
environment:
${file(./env.yml)}
plugins:
- serverless-plugin-scripts
# スケジュール実行は prod ステージでのみ有効にする。
# それ以外のステージ(dev等)ではルールはデプロイされるが無効化される。
# ステージごとの値は params で定義する。
params:
default:
scheduleEnabled: false
prod:
scheduleEnabled: true
custom:
defaultStage: dev
scripts:
hooks:
# ローカルでのビルド時に bootstrap を生成する
'before:package:createDeploymentArtifacts': GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o bootstrap ./cmd/bootstrap
package:
patterns:
- '!./**'
- ./bootstrap
- ./secret.json
functions:
analyticsNotificationsSlack:
handler: bootstrap
events:
- schedule:
rate: cron(0 8 * * ? *) # UTC
enabled: ${param:scheduleEnabled}