-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
84 lines (79 loc) · 1.9 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
service: batida-ponto-serverless
provider:
name: aws
runtime: python3.8
region: us-east-1
stage: dev
iamRoleStatements:
- Effect: Allow
Action:
- "sqs:SendMessage"
Resource: !GetAtt DLQ.Arn
functions:
schema:
handler: schema.main
events:
- http:
path: schema
method: post
batidaPonto:
handler: handler.main
memorySize: 128
events:
- sqs:
arn:
Fn::GetAtt:
- BatidaPontoQueue
- Arn
reservedConcurrency: 5
deadLetter:
targetArn:
GetResourceArn: DLQ
custom:
apiGatewayServiceProxies:
- sqs:
path: /ponto
method: post
queueName: { 'Fn::GetAtt': ['BatidaPontoQueue', 'QueueName'] }
cors: true
response:
template:
success: |-
{ "message": "accepted" }
clientError: |-
{ "message": "there is an error in your request" }
serverError: |-
{ "message": "there was an error handling your request" }
vpc:
vpcName: 'vpc-default'
subnetNames:
- 'vpc-default_subnet-1'
securityGroupNames:
- 'default'
resources:
Resources:
BatidaPontoQueue:
Type: 'AWS::SQS::Queue'
DLQ:
Type: AWS::SQS::Queue
Properties:
QueueName: batidaPonto-dl-queue
RDSCluster:
Type: AWS::RDS::DBCluster
Properties:
MasterUsername: ponto
MasterUserPassword: p0nt0#2020
DBClusterIdentifier: ponto-cluster
DatabaseName: pontodb
Engine: aurora-postgresql
EngineMode: serverless
ScalingConfiguration:
AutoPause: true
MaxCapacity: 2
MinCapacity: 2
SecondsUntilAutoPause: 300
EnableHttpEndpoint: true
plugins:
- serverless-apigateway-service-proxy
- serverless-plugin-lambda-dead-letter
- serverless-vpc-discovery