-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
80 lines (67 loc) · 1.6 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
# serverless.yml
service: serverless-strapi-content-service
frameworkVersion: "3"
useDotenv: true
provider:
name: aws
runtime: nodejs16.x
region: ${env:LAMBDA_REGION}
profile: default
logRetentionInDays: 1
versionFunctions: false
httpApi:
cors: true
vpc:
securityGroupIds: "${split(${env:VPC_SECURITY_GROUP_IDS}, ',')}"
subnetIds: "${split(${env:VPC_SUBNET_IDS}, ',')}"
apiGateway:
binaryMediaTypes: "${split(${env:API_GATEWAY_BINARY_MEDIA_TYPES}, ',')}"
iam:
role:
statements:
# Allow functions to list all buckets
- Effect: Allow
Action: "s3:ListBucket"
Resource: "*"
# Allow functions to read/write objects in a bucket
- Effect: Allow
Action:
- "s3:PutObject"
- "s3:GetObject"
- "s3:ListBucket"
- "s3:DeleteObject"
- "s3:PutObjectAcl"
Resource:
- "arn:aws:s3:::serverless-strapi-bucket"
memorySize: 2048
ecr:
images:
strapi:
path: ./
environment:
SERVER_URL: !GetAtt HttpApi.ApiEndpoint
package:
excludeDevDependencies: true
patterns:
- "build/**"
- "config/**"
- "database/**"
- "node_modules/**"
- "public/**"
- "src/**"
- ".env"
- "package.json"
- "!node_modules/esbuild-linux-64/**"
- "!node_modules/@babel/**"
- "!node_modules/@types/**"
- "!node_modules/webpack/**"
- "!node_modules/@sentry/**"
functions:
strapi:
image:
name: strapi
events:
- httpApi: "*"
plugins:
- serverless-offline
- serverless-plugin-utils