-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathserverless.yml
70 lines (62 loc) · 1.44 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
service:
name: sqs-test-ts
# app and org for use with dashboard.serverless.com
app: sqs-test-ts
org: arjones
custom:
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
# Add the serverless-webpack plugin
plugins:
- serverless-webpack
- serverless-iam-roles-per-function
- serverless-offline
- serverless-prune-plugin
provider:
name: aws
runtime: nodejs12.x
apiGateway:
minimumCompressionSize: 1024 # Enable gzip compression for responses > 1 KB
environment:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
iamRoleStatements:
- Effect: Allow
Action:
- sqs:SendMessage
- sqs:ReceiveMessage
- sqs:DeleteMessage
Resource:
- Fn::GetAtt: [ sqsTestTsQueue, Arn ]
- Fn::GetAtt: [ sqsTestTsQueueResult, Arn ]
functions:
jobSubmit:
handler: handler.jobSubmit
events:
- http:
method: post
path: /sqs/jobSubmit
jobResult:
handler: handler.jobResult
events:
- http:
method: get
path: /sqs/jobResult
worker:
handler: handler.worker
events:
- sqs:
arn:
Fn::GetAtt:
- sqsTestTsQueue
- Arn
resources:
Resources:
sqsTestTsQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: sqsTestTsQueue
sqsTestTsQueueResult:
Type: AWS::SQS::Queue
Properties:
QueueName: sqsTestTsQueueResult