-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtemplate.yaml
46 lines (45 loc) · 1.74 KB
/
template.yaml
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
Transform: 'AWS::Serverless-2016-10-31'
Resources:
filesHandlingFunction:
Type: 'AWS::Serverless::Function'
Properties:
Runtime: nodejs8.10
Handler: index.filesHandler
CodeUri: .
Events:
lambdaGetFile:
Type: Api
Properties:
Path: /getFile/{fileName}
Method: GET
lambdaWriteFile:
Type: Api
Properties:
Path: /writeFile
Method: POST
lambdaUpdateFile:
Type: Api
Properties:
Path: /updateFile
Method: PUT
lambdaDeleteFile:
Type: Api
Properties:
Path: /deleteFile/{fileName}
Method: DELETE
Policies:
- Version: '2012-10-17'
Statement:
# Policy needed to use GetObject with right permissions (it needs to list the objects)
- Sid: ListObjectsInBucket
Effect: Allow
Action:
- s3:ListBucket
Resource:
- arn:aws:s3:::franrobles8-filehandling-bucket
# Policy needed to allow all operations in objects with right permissions
- Sid: AllObjectActions
Effect: Allow
Action: s3:*Object
Resource:
- arn:aws:s3:::franrobles8-filehandling-bucket/*