@@ -34,42 +34,46 @@ configuration. Please see the respective websites for advantages / reasons.
34
34
2 . Clone your fork
35
35
3 . Create a new file in the root folder called 'config.env.production'
36
36
4 . Put your AWS credentials into the file in the following format, only if you want to run a local test (not needed for lambda)
37
- ~~~~
37
+
38
+ ``` javascript
38
39
AWS_ACCESS_KEY_ID = " ###################"
39
40
AWS_SECRET_ACCESS_KEY = " ###############"
40
- ~~~~
41
+ ```
42
+
41
43
5. Update [Region .json ](./ src/ configuration/ Region .json ) to match the region of your DynamoDB instance
42
- 5 . Run 'npm install'
43
- 6 . Run 'npm run build'
44
- 7 . Verify this has created a 'dist.zip' file
45
- 8 . Optionally, run a local test by running 'npm run start'
44
+ 6 . Run ' npm install'
45
+ 7 . Run ' npm run build'
46
+ 8 . Verify this has created a ' dist.zip' file
47
+ 9 . Optionally, run a local test by running ' npm run start'
46
48
47
49
## Running on AWS Lambda
48
50
49
51
1. Follow the steps in ' Running locally'
50
52
2. Create an AWS Policy and Role
51
53
1. Create a policy called ' DynamoDBLambdaAutoscale'
52
54
2. Use the following content to give access to dynamoDB, cloudwatch and lambda logging
53
- ~~~~
54
- {
55
- "Version": "2012-10-17",
56
- "Statement": [
57
- {
58
- "Action": [
59
- "dynamodb:ListTables",
60
- "dynamodb:DescribeTable",
61
- "dynamodb:UpdateTable",
62
- "cloudwatch:GetMetricStatistics",
63
- "logs:CreateLogGroup",
64
- "logs:CreateLogStream",
65
- "logs:PutLogEvents"
66
- ],
67
- "Effect": "Allow",
68
- "Resource": "*"
69
- }
70
- ]
71
- }
72
- ~~~~
55
+
56
+ ` ` ` javascript
57
+ {
58
+ "Version": "2012-10-17",
59
+ "Statement": [
60
+ {
61
+ "Action": [
62
+ "dynamodb:ListTables",
63
+ "dynamodb:DescribeTable",
64
+ "dynamodb:UpdateTable",
65
+ "cloudwatch:GetMetricStatistics",
66
+ "logs:CreateLogGroup",
67
+ "logs:CreateLogStream",
68
+ "logs:PutLogEvents"
69
+ ],
70
+ "Effect": "Allow",
71
+ "Resource": "*"
72
+ }
73
+ ]
74
+ }
75
+ ` ` `
76
+
73
77
3. Create a role called ' DynamoDBLambdaAutoscale'
74
78
4. Attach the newly created policy to the role
75
79
3. Create a AWS Lambda function
0 commit comments