@guardian/cdk 50.10.16 → 50.11.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamodb.d.ts","sourceRoot":"","sources":["../../../../src/constructs/iam/policies/dynamodb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE/D,UAAU,qBAAqB;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,gCAAiC,SAAQ,yBAAyB,EAAE,qBAAqB;IACjG,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,uBAAe,gBAAiB,SAAQ,aAAa;IACnD,SAAS,aAAa,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gCAAgC;
|
|
1
|
+
{"version":3,"file":"dynamodb.d.ts","sourceRoot":"","sources":["../../../../src/constructs/iam/policies/dynamodb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE/D,UAAU,qBAAqB;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,gCAAiC,SAAQ,yBAAyB,EAAE,qBAAqB;IACjG,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,uBAAe,gBAAiB,SAAQ,aAAa;IACnD,SAAS,aAAa,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gCAAgC;CAa1F;AAED,qBAAa,oBAAqB,SAAQ,gBAAgB;gBAC5C,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB;CAGrE;AAED,qBAAa,qBAAsB,SAAQ,gBAAgB;gBAC7C,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB;CAGrE"}
|
|
@@ -7,7 +7,13 @@ class GuDynamoDBPolicy extends base_policy_1.GuAllowPolicy {
|
|
|
7
7
|
super(scope, id, {
|
|
8
8
|
...props,
|
|
9
9
|
actions: props.actions.map((action) => `dynamodb:${action}`),
|
|
10
|
-
|
|
10
|
+
// Note: although the index resource is not supported for all attached actions
|
|
11
|
+
// (e.g. BatchWriteItem), it will not cause issues to include it here as it is ignored.
|
|
12
|
+
// See: https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html
|
|
13
|
+
resources: [
|
|
14
|
+
`arn:aws:dynamodb:${scope.region}:${scope.account}:table/${props.tableName}`,
|
|
15
|
+
`arn:aws:dynamodb:${scope.region}:${scope.account}:table/${props.tableName}/index/*`,
|
|
16
|
+
],
|
|
11
17
|
});
|
|
12
18
|
}
|
|
13
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamodb.js","sourceRoot":"","sources":["../../../../src/constructs/iam/policies/dynamodb.ts"],"names":[],"mappings":";;;AACA,+CAA8C;AAW9C,MAAe,gBAAiB,SAAQ,2BAAa;IACnD,YAAsB,KAAc,EAAE,EAAU,EAAE,KAAuC;QACvF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE;YACf,GAAG,KAAK;YACR,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,MAAM,EAAE,CAAC;YAC5D,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"dynamodb.js","sourceRoot":"","sources":["../../../../src/constructs/iam/policies/dynamodb.ts"],"names":[],"mappings":";;;AACA,+CAA8C;AAW9C,MAAe,gBAAiB,SAAQ,2BAAa;IACnD,YAAsB,KAAc,EAAE,EAAU,EAAE,KAAuC;QACvF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE;YACf,GAAG,KAAK;YACR,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,MAAM,EAAE,CAAC;YAC5D,8EAA8E;YAC9E,uFAAuF;YACvF,gIAAgI;YAChI,SAAS,EAAE;gBACT,oBAAoB,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,UAAU,KAAK,CAAC,SAAS,EAAE;gBAC5E,oBAAoB,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,UAAU,KAAK,CAAC,SAAS,UAAU;aACrF;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAa,oBAAqB,SAAQ,gBAAgB;IACxD,YAAY,KAAc,EAAE,EAAU,EAAE,KAA4B;QAClE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;IACtG,CAAC;CACF;AAJD,oDAIC;AAED,MAAa,qBAAsB,SAAQ,gBAAgB;IACzD,YAAY,KAAc,EAAE,EAAU,EAAE,KAA4B;QAClE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;CACF;AAJD,sDAIC","sourcesContent":["import type { GuStack } from \"../../core\";\nimport { GuAllowPolicy } from \"./base-policy\";\nimport type { GuNoStatementsPolicyProps } from \"./base-policy\";\n\ninterface GuDynamoDBPolicyProps {\n tableName: string;\n}\n\ninterface GuDynamoDBPolicyPropsWithActions extends GuNoStatementsPolicyProps, GuDynamoDBPolicyProps {\n actions: string[];\n}\n\nabstract class GuDynamoDBPolicy extends GuAllowPolicy {\n protected constructor(scope: GuStack, id: string, props: GuDynamoDBPolicyPropsWithActions) {\n super(scope, id, {\n ...props,\n actions: props.actions.map((action) => `dynamodb:${action}`),\n // Note: although the index resource is not supported for all attached actions\n // (e.g. BatchWriteItem), it will not cause issues to include it here as it is ignored.\n // See: https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html\n resources: [\n `arn:aws:dynamodb:${scope.region}:${scope.account}:table/${props.tableName}`,\n `arn:aws:dynamodb:${scope.region}:${scope.account}:table/${props.tableName}/index/*`,\n ],\n });\n }\n}\n\nexport class GuDynamoDBReadPolicy extends GuDynamoDBPolicy {\n constructor(scope: GuStack, id: string, props: GuDynamoDBPolicyProps) {\n super(scope, id, { ...props, actions: [\"BatchGetItem\", \"GetItem\", \"Scan\", \"Query\", \"GetRecords\"] });\n }\n}\n\nexport class GuDynamoDBWritePolicy extends GuDynamoDBPolicy {\n constructor(scope: GuStack, id: string, props: GuDynamoDBPolicyProps) {\n super(scope, id, { ...props, actions: [\"BatchWriteItem\", \"PutItem\", \"DeleteItem\", \"UpdateItem\"] });\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/cdk",
|
|
3
3
|
"description": "Generic Guardian flavoured AWS CDK components",
|
|
4
|
-
"version": "50.
|
|
4
|
+
"version": "50.11.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@oclif/core": "2.15.0",
|
|
57
57
|
"aws-cdk-lib": "2.95.1",
|
|
58
|
-
"aws-sdk": "^2.
|
|
58
|
+
"aws-sdk": "^2.1457.0",
|
|
59
59
|
"chalk": "^4.1.2",
|
|
60
60
|
"codemaker": "^1.88.0",
|
|
61
61
|
"constructs": "10.2.70",
|