-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
93 lines (86 loc) · 2.49 KB
/
serverless.yml
File metadata and controls
93 lines (86 loc) · 2.49 KB
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
85
86
87
88
89
90
91
92
93
service: gratitude-jar
frameworkVersion: "2"
provider:
name: aws
region: eu-central-1
profile: gratitude-jar
apiGateway:
minimumCompressionSize: 1024
shouldStartNameWithService: true
environment:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1"
FILES_BUCKET: files.sloikwdziecznosci.pl
APP_BUCKET: app.sloikwdziecznosci.pl
FONT_SIZE: "12"
CARD_HEIGHT_MM: "50"
CARD_WIDTH_MM: "81"
lambdaHashingVersion: "20201221"
iamRoleStatements:
- Effect: Allow
Action:
- s3:GetObject
- s3:GetObjectAcl
- s3:PutObject
- s3:PutObjectAcl
- s3:DeleteObject
- s3:GetSignedUrl
Resource: "*"
custom:
bundle:
copyFiles:
- from: "fonts/*"
to: "./src"
externals:
- pdfkit
remover:
buckets:
- ${self:provider.environment.FILES_BUCKET}
s3:
host: localhost
directory: "./.buckets"
s3Sync:
- bucketName: ${self:provider.environment.APP_BUCKET}
localDir: "/app"
package:
individually: true
functions:
generatePrintFile:
handler: src/generatePrintFile.handler
events:
- http:
path: /
method: post
cors: true
resources:
Resources:
WebAppS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:provider.environment.APP_BUCKET}
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
GratitudeFilesS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:provider.environment.FILES_BUCKET}
AccessControl: Private
WebAppS3BucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: WebAppS3Bucket
PolicyDocument:
Statement:
Sid: PublicReadGetObject
Effect: Allow
Principal: "*"
Action:
- s3:GetObject
Resource: arn:aws:s3:::${self:provider.environment.APP_BUCKET}/*
plugins:
- serverless-s3-sync
- serverless-s3-remover
- serverless-s3-local
- serverless-bundle
- serverless-offline