-
Notifications
You must be signed in to change notification settings - Fork 4
/
serverless.yml
58 lines (51 loc) · 1.15 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
service: sql-offline
plugins:
- ./dist/index.js
- serverless-webpack
- serverless-offline
custom:
defaultStage: dev
currentStage: ${opt:stage, self:custom.defaultStage}
sqsListener: 'test-sqs'
serverless-offline:
port: 5000
serverless-offline-sqs-external:
autoCreate: true
apiVersion: '2012-11-05'
endpoint: 'http://localstack:4576'
region: us-east-1
accessKeyId: root
secretAccessKey: root
skipCacheInvalidation: false
provider:
name: aws
runtime: nodejs12.x
memorySize: 512
stage: ${self:custom.currentStage}
timeout: 10
region: us-east-1
iamRoleStatements:
- Effect: Allow
Action:
- sqs:SendMessage
Resource:
- "arn:aws:sqs:${self:provider.region}:*:${self:custom.sqsListener}"
functions:
main:
handler: lambdas/index.handler
sqs:
handler: lambdas/worker.handler
events:
- sqs:
arn:
Fn::GetAtt:
- SqsListener
- Arn
batchSize: 1
resources:
Resources:
SqsListener:
Type: "AWS::SQS::Queue"
Properties:
QueueName: ${self:custom.sqsListener}
DelaySeconds: 120