-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
62 lines (56 loc) · 1.74 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
service: laravel-starter-serverless
provider:
name: aws
region: ap-south-1
runtime: provided
plugins:
- ./vendor/bref/bref
package:
exclude:
- node_modules/**
- public/storage
- resources/assets/**
- storage/**
- tests/**
functions:
website:
handler: public/index.php
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
layers:
- ${bref:layer.php-73-fpm}
events:
- http: 'ANY /'
- http: 'ANY /{proxy+}'
artisan:
handler: artisan
timeout: 120 # in seconds
layers:
- ${bref:layer.php-73} # PHP
- ${bref:layer.console} # The "console" layer
worker:
handler: worker.php
layers:
- ${bref:layer.php-73}
events:
# Declares that our worker is triggered by jobs in SQS
- sqs:
arn: !GetAtt AlertQueue.Arn
# If you create the queue manually, the line above could be:
# arn: 'arn:aws:sqs:us-east-1:1234567890:my_sqs_queue'
# Only 1 item at a time to simplify error handling
batchSize: 1
resources:
Resources:
# The SQS queue
AlertQueue:
Type: AWS::SQS::Queue
Properties:
RedrivePolicy:
maxReceiveCount: 3 # jobs will be retried up to 3 times
# Failed jobs (after the retries) will be moved to the other queue for storage
deadLetterTargetArn: !GetAtt DeadLetterQueue.Arn
# Failed jobs will go into that SQS queue to be stored, until a developer looks at these errors
DeadLetterQueue:
Type: AWS::SQS::Queue
Properties:
MessageRetentionPeriod: 1209600 # maximum retention: 14 days