-
Notifications
You must be signed in to change notification settings - Fork 11
/
serverless.yml
95 lines (88 loc) · 2.15 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
service: s3-crash-course
frameworkVersion: "2"
provider:
name: aws
runtime: nodejs14.x
lambdaHashingVersion: 20201221
stage: dev
region: ap-south-1
apiGateway:
shouldStartNameWithService: true
iam:
role:
statements:
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:PutObject"
- "s3:AbortMultipartUpload"
Resource: "arn:aws:s3:::${self:custom.bucketName}/*"
environment:
bucketName: ${self:custom.bucketName}
custom:
bucketName: aws-troll
functions:
putObject:
handler: objects/API/putObject.handler
events:
- http:
path: /putObject
method: post
cors: true
getSignedUrl:
handler: objects/API/putPreSignedUrl.handler
events:
- http:
path: /getSignedUrl
method: post
cors: true
getUploadId:
handler: objects/API/multiPartUpload/createMultiPartUpload.handler
events:
- http:
path: /getUploadId
method: post
cors: true
getUploadPart:
handler: objects/API/multiPartUpload/getUploadPart.handler
events:
- http:
path: /getUploadPart
method: post
cors: true
completeMultiPartUpload:
handler: objects/API/multiPartUpload/completeMultipartUpload.handler
events:
- http:
path: /completeUpload
method: post
cors: true
abortMultiPartUpload:
handler: objects/API/multiPartUpload/abortMultiPartUpload.handler
events:
- http:
path: /abortUpload
method: post
cors: true
resources:
Resources:
UploadBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucketName}
AccessControl: Private
CorsConfiguration:
CorsRules:
- AllowedMethods:
- GET
- PUT
- POST
- HEAD
AllowedOrigins:
- "*"
AllowedHeaders:
- "*"
ExposedHeaders:
- ETag
plugins:
- serverless-ignore