-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
74 lines (64 loc) · 1.33 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
service: readql
frameworkVersion: "3"
provider:
name: aws
region: eu-west-1
runtime: python3.11
logRetentionInDays: 7
versionFunctions: false
httpApi:
cors: true
metrics: true
ecr:
images:
readql:
path: "./"
iam:
role:
statements:
- Effect: "Allow"
Resource:
- "arn:aws:s3:::${self:resources.Resources.bucket.Properties.BucketName}/*"
Action:
- "s3:GetObject"
- "s3:PutObject"
- "s3:DeleteObject"
package:
patterns:
- "!./**"
- "./handler.py"
- "./readql/**"
functions:
readql:
image: readql
timeout: 10
memorySize: 256
events:
- httpApi:
method: GET
path: "/{proxy+}"
environment:
READQL_S3_BUCKET_NAME: ${self:resources.Resources.bucket.Properties.BucketName}
s3guard:
handler: handler.s3guard
timeout: 10
memorySize: 128
events:
- s3:
bucket: ${self:resources.Resources.bucket.Properties.BucketName}
event: "s3:ObjectCreated:*"
existing: true
forceDeploy: true
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
noDeploy:
- boto3
- botocore
resources:
Resources:
bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: readql