-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathtemplate.yml
50 lines (50 loc) · 1.38 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
44
45
46
47
48
49
50
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: Transforms images by applying blur of a configured radius
Resources:
transform:
Type: AWS::Serverless::Function
Properties:
Description: Transforms images by applying blur of a configured radius
Handler: bundle.handler
Runtime: nodejs18.x
CodeUri: bundle.js
MemorySize: 1536
Policies:
- S3ReadPolicy:
BucketName:
Ref: sourceBucket
- S3WritePolicy:
BucketName:
Ref: destBucket
Timeout: 300
Events:
upload:
Type: S3
Properties:
Bucket:
Ref: source
Events: s3:ObjectCreated:*
Environment:
Variables:
DEST_BUCKET:
Ref: destBucket
BLUR_RADIUS:
Ref: blurRadius
NODE_OPTIONS: --enable-source-maps
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)
blurRadius:
Type: Number
Description: Pixel radius of the blur to apply
Default: 10