-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
62 lines (55 loc) · 2.22 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
service: dynamoDB-all-version-crud
provider:
name: aws
architecture: arm64
runtime: nodejs18.x
region: ${opt:region, "us-east-1"}
functions:
#CRUD Lambda functions using SDK Version 3
createUserVersion3: ${file(./resources/lambda/version3/createUserLambda.yml)}
getUserVersion3: ${file(./resources/lambda/version3/getUserLambda.yml)}
updateUserVersion3: ${file(./resources/lambda/version3/updateUserLambda.yml)}
deleteUserVersion3: ${file(./resources/lambda/version3/deleteUserLambda.yml)}
scanUserVersion3: ${file(./resources/lambda/version3/scanUserLambda.yml)}
queryUserVersion3: ${file(./resources/lambda/version/queryUserLambda.yml)}
#CRUD Lambda functions using SDK Version 2
createUserVersion2: ${file(./resources/lambda/version2/createUserLambda.yml)}
getUserVersion2: ${file(./resources/lambda/version2/getUserLambda.yml)}
updateUserVersion2: ${file(./resources/lambda/version2/updateUserLambda.yml)}
deleteUserVersion2: ${file(./resources/lambda/version2/deleteUserLambda.yml)}
scanUserVersion2: ${file(./resources/lambda/version2/scanUserLambda.yml)}
queryUserVersion2: ${file(./resources/lambda/version2/queryUserLambda.yml)}
resources:
Resources:
UserTable: ${file(./resources/dynamo/userTable.yml)}
CRUDRole:
Type: AWS::IAM::Role
Properties:
RoleName: CRUDRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: CRUDPolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:GetItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:Scan
- dynamodb:Query
Resource: "*"
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: "*"