-
Notifications
You must be signed in to change notification settings - Fork 3
/
serverless.yml
67 lines (62 loc) · 1.93 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
service: app
provider:
name: aws
region: us-east-1
stage: dev
runtime: provided
environment:
# Laravel environment variables
APP_ENV: 'production'
APP_STORAGE: '/tmp/storage'
plugins:
- ./vendor/bref/bref
package:
exclude:
- .env
- .env.local
- 'node_modules/**'
- 'database/**'
- 'storage/**'
- 'tests/**'
- 'resources/img/**'
- 'resources/js/**'
- 'resources/sass/**'
- 'public/img/**'
- 'public/css/**'
- 'public/js/**'
functions:
website:
handler: public/index.php
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
layers:
- ${bref:layer.php-72-fpm}
events:
- http: 'ANY /'
- http: 'ANY /{proxy+}'
artisan:
handler: artisan
timeout: 120 # in seconds
layers:
- ${bref:layer.php-72} # PHP
- ${bref:layer.console} # The "console" layer
resources:
Resources:
Assets: # The S3 bucket that stores the assets
Type: AWS::S3::Bucket
Properties:
BucketName: uscis-case-tracker
CorsConfiguration:
CorsRules:
- AllowedHeaders: ["*"]
AllowedMethods: [GET]
AllowedOrigins: ["*"]
AssetsBucketPolicy: # The policy that makes the bucket publicly readable
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref Assets # References the bucket we defined above
PolicyDocument:
Statement:
- Effect: Allow
Principal: '*' # everyone
Action: 's3:GetObject' # to read
Resource: 'arn:aws:s3:::uscis-case-tracker/*' # things in the bucket