-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
53 lines (48 loc) · 1.06 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
plugins:
- serverless-api-gateway-throttling
- serverless-associate-waf
service: sqsgateway
provider:
name: aws
stage: ${opt:stage, 'dev'}
runtime: nodejs18.x
environment:
SQS_HTTP_URL:
Ref: AsyncAPIQueue
API_KEY_ARN:
Ref: APIKeySecret
iamRoleStatements:
- Effect: "Allow"
Action:
- "sqs:GetQueueUrl"
- "sqs:SendMessage"
Resource:
- 'Fn::GetAtt': [AsyncAPIQueue, Arn]
- Effect: "Allow"
Action:
- "secretsmanager:GetSecretValue"
Resource:
- Ref: APIKeySecret
custom:
apiGatewayThrottling:
maxRequestsPerSecond: 1
maxConcurrentRequests: 1
associateWaf:
name: ${self:service}-${self:provider.stage}-WebACL
version: V2
functions:
submit:
handler: handlers/push.post
timeout: 30
response:
headers:
Content-Type: "'application/json'"
events:
- http:
path: submit
method: POST
cors: true
resources:
- ${file(resources/sqs.yml)}
- ${file(resources/secrets.yml)}
- ${file(resources/waf.yml)}