forked from evanchiu/serverless-galleria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
43 lines (43 loc) · 1.17 KB
/
template.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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: Transforms images by applying sepia tone
Resources:
transform:
Type: AWS::Serverless::Function
Properties:
Description: Transforms images by applying sepia tone
Handler: src/index.handler
Runtime: nodejs12.x
CodeUri: build/transform.zip
MemorySize: 1536
Policies:
- S3ReadPolicy:
BucketName:
Ref: sourceBucket
- S3CrudPolicy:
BucketName:
Ref: destBucket
Timeout: 300
Events:
upload:
Type: S3
Properties:
Bucket:
Ref: source
Events: s3:ObjectCreated:*
Environment:
Variables:
DEST_BUCKET:
Ref: destBucket
source:
Type: AWS::S3::Bucket
Properties:
BucketName:
Ref: sourceBucket
Parameters:
sourceBucket:
Type: String
Description: Name of the S3 Bucket to read source images from (must NOT exist prior to deployment)
destBucket:
Type: String
Description: Name of the S3 Bucket to put transformed images into (must exist prior to deployment)