-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml.example
50 lines (43 loc) · 1.2 KB
/
serverless.yml.example
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
service: meme-lambda
frameworkVersion: '3'
provider:
name: aws
runtime: python3.10
region: eu-central-1 # your region here
memorySize: 128 # optional, in MB, default is 1024
# https://www.serverless.com/framework/docs/providers/aws/guide/iam
iam:
role:
statements:
- Effect: Allow
Action: 's3:ListBucket'
Resource:
- 'arn:aws:s3:::${self:custom.s3BucketName}'
# Allow functions to read/write objects in a bucket
- Effect: Allow
Action:
- 's3:GetObject'
Resource:
- 'arn:aws:s3:::${self:custom.s3BucketName}/*'
apiGateway:
apiKeys:
- "your-api-key"
binaryMediaTypes:
- '*/*'
functions:
meme-func:
handler: handler.lambda_handler
environment:
S3_BUCKET: ${self:custom.s3BucketName}
events:
# Gateway type: REST vs HTTP API
# - httpApi:
- http:
path: /meme
method: GET
# enable if wish to use API key
private: true
# Configure the size of ephemeral storage available to your Lambda function (in MBs, default: 512)
ephemeralStorageSize: 512
custom:
s3BucketName: meme-storage-bucket-name