-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
61 lines (53 loc) · 1.3 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
service: ${self:custom.mainAppName.${opt:stage, 'dev'}}-functions
frameworkVersion: ">=2.63.0 <2.72.3"
useDotenv: true
plugins:
- serverless-hooks-plugin
- serverless-step-functions
custom:
mainAppName:
dev: go-sfn
deploymentBuckets:
dev: dev-sls-bucket
hooks:
before:package:initialize:
- env GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o functions/step functions/step/main.go
after:deploy:finalize:
- rm -rf .serverless functions/step/main
provider:
lambdaHashingVersion: "20201221"
name: aws
runtime: go1.x
memorySize: 128
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'ap-southeast-1'}
package:
individually: true
patterns:
- "!./**"
- .env
functions:
TestStep:
name: ${self:service}-step-${opt:stage, 'dev'}
timeout: 900
handler: functions/step/main
package:
patterns:
- functions/step/main
stepFunctions:
stateMachines:
myStateMachine:
name: "vuduongtp"
definition:
Comment: "Wait 30s then run Lambda function"
StartAt: WaitFewSeconds
States:
WaitFewSeconds:
Type: Wait
Seconds: 30
Next: RunLambda
RunLambda:
Type: Task
Resource:
Fn::GetAtt: [TestStep, Arn]
End: true