-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yml
67 lines (60 loc) · 1.2 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: serverless-og-images-generator
provider:
name: aws
runtime: nodejs12.x
environment:
BUCKET_NAME: dynobase-og-images
iamRoleStatements:
- Effect: 'Allow'
Action:
- 's3:ListBucket'
Resource:
Fn::Join:
- ''
- - 'arn:aws:s3:::'
- Ref: ImagesCacheBucket
- Effect: 'Allow'
Action:
- 's3:PutObject'
Resource:
Fn::Join:
- ''
- - 'arn:aws:s3:::'
- Ref: ImagesCacheBucket
- '/*'
package:
exclude:
- layer/**
- chrome-aws-lambda/**
- node_modules/chrome-aws-lambda/**
include:
index.html
plugins:
- serverless-apigw-binary
- serverless-apigwy-binary
custom:
apigwBinary:
types:
- '*/*'
functions:
og-image-generator:
handler: handler.index
timeout: 30
memorySize: 2048
events:
- http:
method: GET
path: /og-image
layers:
- { Ref: ChromeLambdaLayer }
layers:
chrome:
package:
artifact: layer/chrome.zip
resources:
Resources:
ImagesCacheBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: dynobase-og-images
AccessControl: PublicRead