File tree Expand file tree Collapse file tree 2 files changed +25
-20
lines changed Expand file tree Collapse file tree 2 files changed +25
-20
lines changed Original file line number Diff line number Diff line change 1
- AWSTemplateFormatVersion : ' 2010-09-09'
1
+ AWSTemplateFormatVersion : " 2010-09-09"
2
2
Transform : AWS::Serverless-2016-10-31
3
3
Description : Simple CRUD webservice. State is stored in a SimpleTable (DynamoDB) resource.
4
4
Resources :
@@ -8,7 +8,9 @@ Resources:
8
8
Handler : index.get
9
9
Runtime : nodejs6.10
10
10
CodeUri : src/
11
- Policies : AmazonDynamoDBReadOnlyAccess
11
+ Policies :
12
+ - DynamoDBReadPolicy :
13
+ TableName : !Ref Table
12
14
Environment :
13
15
Variables :
14
16
TABLE_NAME : !Ref Table
@@ -25,7 +27,9 @@ Resources:
25
27
Handler : index.put
26
28
Runtime : nodejs6.10
27
29
CodeUri : src/
28
- Policies : AmazonDynamoDBFullAccess
30
+ Policies :
31
+ - DynamoDBCrudPolicy :
32
+ TableName : !Ref Table
29
33
Environment :
30
34
Variables :
31
35
TABLE_NAME : !Ref Table
@@ -42,7 +46,9 @@ Resources:
42
46
Handler : index.delete
43
47
Runtime : nodejs6.10
44
48
CodeUri : src/
45
- Policies : AmazonDynamoDBFullAccess
49
+ Policies :
50
+ - DynamoDBCrudPolicy :
51
+ TableName : !Ref Table
46
52
Environment :
47
53
Variables :
48
54
TABLE_NAME : !Ref Table
@@ -57,7 +63,6 @@ Resources:
57
63
Type : AWS::Serverless::SimpleTable
58
64
59
65
Outputs :
60
- ApiURL :
61
- Description : " API endpoint URL for Prod environment"
62
- Value : !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/resource/"
63
-
66
+ ApiURL :
67
+ Description : " API endpoint URL for Prod environment"
68
+ Value : !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/resource/"
Original file line number Diff line number Diff line change 1
- AWSTemplateFormatVersion : ' 2010-09-09'
1
+ AWSTemplateFormatVersion : " 2010-09-09"
2
2
Transform : AWS::Serverless-2016-10-31
3
3
Description : IoT -> Lambda -> DynamoDB
4
4
Resources :
5
- IoTFunction :
5
+ IoTFunction :
6
6
Type : AWS::Serverless::Function
7
- Properties :
7
+ Properties :
8
8
Handler : index.handler
9
9
Runtime : nodejs6.10
10
10
CodeUri : src/
11
- Policies : AmazonDynamoDBFullAccess
12
- Environment :
13
- Variables :
14
- TABLE_NAME :
11
+ Policies :
12
+ - DynamoDBCrudPolicy :
13
+ TableName : !Ref Table
14
+ Environment :
15
+ Variables :
16
+ TABLE_NAME :
15
17
Ref : Table
16
- Events :
17
- IoT :
18
+ Events :
19
+ IoT :
18
20
Type : IoTRule
19
- Properties :
21
+ Properties :
20
22
AwsIotSqlVersion : 2016-03-23
21
23
Sql : " SELECT * FROM 'iot2ddb'"
22
24
Table :
@@ -25,5 +27,3 @@ Resources:
25
27
PrimaryKey :
26
28
Name : id
27
29
Type : String
28
-
29
-
You can’t perform that action at this time.
0 commit comments