wirejs-deploy-amplify-basic 0.0.85-table-resource → 0.0.87-table-resource
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,10 +9,10 @@ import { api } from './functions/api/resource';
|
|
|
9
9
|
import { auth } from './auth/resource';
|
|
10
10
|
import { TableDefinition, indexName } from 'wirejs-resources';
|
|
11
11
|
import { TableIndexes } from './constructs/table-indexes';
|
|
12
|
+
import { PolicyStatement } from 'aws-cdk-lib/aws-iam';
|
|
12
13
|
|
|
13
14
|
// @ts-ignore
|
|
14
15
|
import generated from './generated-resources';
|
|
15
|
-
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
16
16
|
|
|
17
17
|
const APP_ID = process.env.AWS_APP_ID ?? process.env.PWD?.replace(/[^a-zA-Z0-9-_]/g, '_');
|
|
18
18
|
const BRANCH_ID = process.env.AWS_BRANCH ?? process.env.USER ?? 'anonymous';
|
|
@@ -109,6 +109,21 @@ for (const resource of generated) {
|
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
table.grantReadWriteData(backend.api.resources.lambda);
|
|
112
|
+
|
|
113
|
+
// indexes created by custom resource and require explicit
|
|
114
|
+
// permissions to be added to the lambda role (apparently).
|
|
115
|
+
backend.api.resources.lambda.addToRolePolicy(new PolicyStatement({
|
|
116
|
+
actions: [
|
|
117
|
+
"dynamodb:Query",
|
|
118
|
+
"dynamodb:Scan",
|
|
119
|
+
"dynamodb:GetItem",
|
|
120
|
+
"dynamodb:BatchGetItem",
|
|
121
|
+
],
|
|
122
|
+
resources: [
|
|
123
|
+
table.tableArn,
|
|
124
|
+
`${table.tableArn}/index/*`,
|
|
125
|
+
],
|
|
126
|
+
}))
|
|
112
127
|
}
|
|
113
128
|
}
|
|
114
129
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wirejs-deploy-amplify-basic",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.87-table-resource",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"recursive-copy": "^2.0.14",
|
|
33
33
|
"rimraf": "^6.0.1",
|
|
34
34
|
"wirejs-dom": "^1.0.38",
|
|
35
|
-
"wirejs-resources": "^0.1.
|
|
35
|
+
"wirejs-resources": "^0.1.55-table-resource"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@aws-amplify/backend": "^1.14.0",
|