-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathtemplate.yml
48 lines (45 loc) · 1.11 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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: Serverless web application for uploading files to S3
Globals:
Api:
BinaryMediaTypes:
- '*~1*'
Resources:
uploader:
Type: AWS::Serverless::Function
Properties:
Description: Serverless web application for uploading files to S3
Handler: src/index.handler
Runtime: nodejs18.x
CodeUri: package.zip
MemorySize: 1536
Policies:
- S3WritePolicy:
BucketName:
Ref: destBucket
Timeout: 60
Events:
root:
Type: Api
Properties:
Path: /
Method: get
getProxy:
Type: Api
Properties:
Path: '/{proxy+}'
Method: get
postProxy:
Type: Api
Properties:
Path: '/{proxy+}'
Method: post
Environment:
Variables:
DEST_BUCKET:
Ref: destBucket
Parameters:
destBucket:
Type: String
Description: Name of the S3 Bucket to put uploaded files into (must exist prior to deployment)