-
Notifications
You must be signed in to change notification settings - Fork 31
/
serverless.yml
57 lines (49 loc) · 1.51 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
service: bref-example-laravel-queues
provider:
name: aws
# The AWS region in which to deploy (us-east-1 is the default)
region: us-east-1
# Environment variables
environment:
APP_ENV: production # Or use ${sls:stage} if you want the environment to match the stage
APP_KEY: 'base64:/EStlF5sExBpWdQ3eB/h+F2zzKGDc5bvDzwe0KD8ZPg='
QUEUE_CONNECTION: sqs
SQS_QUEUE: ${construct:jobs.queueUrl}
package:
# Files and directories to exclude from deployment
patterns:
- '!node_modules/**'
- '!public/storage'
- '!resources/assets/**'
- '!storage/**'
- '!tests/**'
- '!.env'
functions:
# This function runs the Laravel website/API
web:
handler: public/index.php
runtime: php-81-fpm
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
events:
- httpApi: '*'
# This function lets us run artisan commands in Lambda
artisan:
handler: artisan
runtime: php-81-console
timeout: 720 # in seconds
# Uncomment to also run the scheduler every minute
#events:
# - schedule:
# rate: rate(1 minute)
# input: '"schedule:run"'
constructs:
jobs:
type: queue
# This function runs Laravel Queues
worker:
handler: Bref\LaravelBridge\Queue\QueueHandler
runtime: php-81
timeout: 60 # seconds
plugins:
- ./vendor/bref/bref
- serverless-lift