-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
51 lines (47 loc) · 924 Bytes
/
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
service:
name: simple-s3-proxy
plugins:
- serverless-webpack
provider:
name: aws
runtime: nodejs10.x
region: ap-northeast-2
stage: production
environment:
BUCKET_NAME: ${env:BUCKET_NAME}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:PutObject"
- "s3:DeleteObject"
Resource:
- "arn:aws:s3:::${env:BUCKET_NAME}/*"
functions:
put:
handler: handler.put
events:
- http:
method: put
path: /{key}
cors: true
get:
handler: handler.get
events:
- http:
method: get
path: /{key}
cors: true
delete:
handler: handler.erase
events:
- http:
method: delete
path: /{key}
cors: true
resources:
Resources:
ConfigBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${env:BUCKET_NAME}