@guardian/cdk 61.3.0 → 61.3.1
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":"kcl.d.ts","sourceRoot":"","sources":["../../../../src/constructs/iam/policies/kcl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"kcl.d.ts","sourceRoot":"","sources":["../../../../src/constructs/iam/policies/kcl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB;AAyBD;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,QAAQ;gBAC3B,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc;CAgC9D"}
|
|
@@ -18,8 +18,10 @@ const actionsOnAllTables = [
|
|
|
18
18
|
"DescribeTable",
|
|
19
19
|
"GetItem",
|
|
20
20
|
"PutItem",
|
|
21
|
+
"UpdateItem",
|
|
22
|
+
"DeleteItem",
|
|
21
23
|
];
|
|
22
|
-
const additionalLeaseTableActions = ["UpdateTable"
|
|
24
|
+
const additionalLeaseTableActions = ["UpdateTable"];
|
|
23
25
|
/**
|
|
24
26
|
* Creates an `AWS::IAM::Policy` to grant all the required permissions for the Kinesis Client Library
|
|
25
27
|
* (https://github.com/awslabs/amazon-kinesis-client) - specifically for KCL v3, which requires many
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kcl.js","sourceRoot":"","sources":["../../../../src/constructs/iam/policies/kcl.ts"],"names":[],"mappings":";;;AAAA,iDAA8D;AAE9D,+CAAyC;AAOzC,MAAM,cAAc,GAAa;IAC/B,gBAAgB;IAChB,uBAAuB;IACvB,wBAAwB;IACxB,YAAY;IACZ,kBAAkB;IAClB,YAAY;CACb,CAAC;AAEF,MAAM,4BAA4B,GAAa,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,CAAC;AAE9F,MAAM,kBAAkB,GAAa;IACnC,MAAM;IACN,aAAa;IACb,eAAe;IACf,SAAS;IACT,SAAS;
|
|
1
|
+
{"version":3,"file":"kcl.js","sourceRoot":"","sources":["../../../../src/constructs/iam/policies/kcl.ts"],"names":[],"mappings":";;;AAAA,iDAA8D;AAE9D,+CAAyC;AAOzC,MAAM,cAAc,GAAa;IAC/B,gBAAgB;IAChB,uBAAuB;IACvB,wBAAwB;IACxB,YAAY;IACZ,kBAAkB;IAClB,YAAY;CACb,CAAC;AAEF,MAAM,4BAA4B,GAAa,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,CAAC;AAE9F,MAAM,kBAAkB,GAAa;IACnC,MAAM;IACN,aAAa;IACb,eAAe;IACf,SAAS;IACT,SAAS;IACT,YAAY;IACZ,YAAY;CACb,CAAC;AAEF,MAAM,2BAA2B,GAAa,CAAC,aAAa,CAAC,CAAC;AAE9D;;;;;;GAMG;AACH,MAAa,WAAY,SAAQ,sBAAQ;IACvC,YAAY,KAAc,EAAE,EAAU,EAAE,KAAqB;QAC3D,SAAS,KAAK,CAAC,UAAkB,EAAE,OAAiB,EAAE,SAAmB;YACvE,OAAO,IAAI,yBAAe,CAAC;gBACzB,MAAM,EAAE,gBAAM,CAAC,KAAK;gBACpB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU,IAAI,CAAC,EAAE,CAAC;gBACjD,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,UAAU,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC;aAC/F,CAAC,CAAC;QACL,CAAC;QAED,SAAS,aAAa,CAAC,OAAiB,EAAE,iBAA2B;YACnE,OAAO,KAAK,CACV,UAAU,EACV,OAAO,EACP,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,IAAI,EAAE,CAAC,CACjD,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC;QACzC,MAAM,YAAY,GAAG,GAAG,KAAK,CAAC,eAAe,oBAAoB,CAAC;QAClE,MAAM,gBAAgB,GAAG,GAAG,KAAK,CAAC,eAAe,mBAAmB,CAAC;QAErE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE;YACf,UAAU,EAAE;gBACV,KAAK,CAAC,SAAS,EAAE,cAAc,EAAE,CAAC,UAAU,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;gBAChE,KAAK,CAAC,SAAS,EAAE,4BAA4B,EAAE,CAAC,UAAU,KAAK,CAAC,UAAU,aAAa,CAAC,CAAC;gBACzF,aAAa,CAAC,kBAAkB,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;gBAC/E,aAAa,CAAC,2BAA2B,EAAE,CAAC,UAAU,CAAC,CAAC;gBACxD,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,UAAU,UAAU,CAAC,CAAC;gBACnD,KAAK,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;aAC9C;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAjCD,kCAiCC","sourcesContent":["import { Effect, PolicyStatement } from \"aws-cdk-lib/aws-iam\";\nimport type { GuStack } from \"../../core\";\nimport { GuPolicy } from \"./base-policy\";\n\nexport interface KCLApplication {\n streamName: string;\n applicationName: string;\n}\n\nconst kinesisActions: string[] = [\n \"DescribeStream\",\n \"DescribeStreamSummary\",\n \"RegisterStreamConsumer\",\n \"GetRecords\",\n \"GetShardIterator\",\n \"ListShards\",\n];\n\nconst kinesisEnhancedFanOutActions: string[] = [\"SubscribeToShard\", \"DescribeStreamConsumer\"];\n\nconst actionsOnAllTables: string[] = [\n \"Scan\",\n \"CreateTable\", // Allow KCL creating the lease, metrics, and coordinator tables - see https://github.com/guardian/cdk/pull/2578#discussion_r1954061397\n \"DescribeTable\",\n \"GetItem\",\n \"PutItem\",\n \"UpdateItem\",\n \"DeleteItem\",\n];\n\nconst additionalLeaseTableActions: string[] = [\"UpdateTable\"];\n\n/**\n * Creates an `AWS::IAM::Policy` to grant all the required permissions for the Kinesis Client Library\n * (https://github.com/awslabs/amazon-kinesis-client) - specifically for KCL v3, which requires many\n * additional permissions over KCL v2.\n *\n * @see https://docs.aws.amazon.com/streams/latest/dev/kcl-iam-permissions.html\n */\nexport class GuKCLPolicy extends GuPolicy {\n constructor(scope: GuStack, id: string, props: KCLApplication) {\n function allow(actionType: string, actions: string[], resources: string[]): PolicyStatement {\n return new PolicyStatement({\n effect: Effect.ALLOW,\n actions: actions.map((a) => `${actionType}:${a}`),\n resources: resources.map((r) => `arn:aws:${actionType}:${scope.region}:${scope.account}:${r}`),\n });\n }\n\n function allowDynamoDB(actions: string[], tableOrIndexNames: string[]): PolicyStatement {\n return allow(\n \"dynamodb\",\n actions,\n tableOrIndexNames.map((name) => `table/${name}`),\n );\n }\n\n const leaseTable = props.applicationName;\n const metricsTable = `${props.applicationName}-WorkerMetricStats`;\n const coordinatorTable = `${props.applicationName}-CoordinatorState`;\n\n super(scope, id, {\n statements: [\n allow(\"kinesis\", kinesisActions, [`stream/${props.streamName}`]),\n allow(\"kinesis\", kinesisEnhancedFanOutActions, [`stream/${props.streamName}/consumer/*`]),\n allowDynamoDB(actionsOnAllTables, [leaseTable, metricsTable, coordinatorTable]),\n allowDynamoDB(additionalLeaseTableActions, [leaseTable]),\n allowDynamoDB([\"Query\"], [`${leaseTable}/index/*`]),\n allow(\"cloudwatch\", [\"PutMetricData\"], [\"*\"]),\n ],\n });\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": "61.3.
|
|
4
|
+
"version": "61.3.1",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"cli:dev": "ts-node src/bin/index.ts"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@changesets/cli": "2.
|
|
31
|
+
"@changesets/cli": "2.28.1",
|
|
32
32
|
"@guardian/eslint-config-typescript": "8.0.0",
|
|
33
33
|
"@guardian/eslint-plugin-tsdoc-required": "^0.1.3",
|
|
34
34
|
"@guardian/tsconfig": "^1.0.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/lodash.camelcase": "^4.3.9",
|
|
39
39
|
"@types/lodash.kebabcase": "^4.1.9",
|
|
40
40
|
"@types/lodash.upperfirst": "^4.3.9",
|
|
41
|
-
"@types/node": "22.13.
|
|
41
|
+
"@types/node": "22.13.4",
|
|
42
42
|
"@types/yargs": "^17.0.33",
|
|
43
43
|
"aws-cdk": "2.178.1",
|
|
44
44
|
"aws-cdk-lib": "2.178.1",
|
|
@@ -47,19 +47,19 @@
|
|
|
47
47
|
"eslint-plugin-custom-rules": "file:tools/eslint",
|
|
48
48
|
"gh-pages": "^6.3.0",
|
|
49
49
|
"jest": "^29.7.0",
|
|
50
|
-
"prettier": "^3.
|
|
50
|
+
"prettier": "^3.5.2",
|
|
51
51
|
"serve": "^14.2.4",
|
|
52
|
-
"ts-jest": "^29.2.
|
|
52
|
+
"ts-jest": "^29.2.6",
|
|
53
53
|
"ts-node": "^10.9.2",
|
|
54
|
-
"typedoc": "^0.27.
|
|
54
|
+
"typedoc": "^0.27.7",
|
|
55
55
|
"typescript": "5.1.6"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@oclif/core": "3.26.6",
|
|
59
59
|
"aws-sdk": "^2.1692.0",
|
|
60
60
|
"chalk": "^4.1.2",
|
|
61
|
-
"codemaker": "^1.
|
|
62
|
-
"git-url-parse": "^16.0.
|
|
61
|
+
"codemaker": "^1.108.0",
|
|
62
|
+
"git-url-parse": "^16.0.1",
|
|
63
63
|
"js-yaml": "^4.1.0",
|
|
64
64
|
"lodash.camelcase": "^4.3.0",
|
|
65
65
|
"lodash.kebabcase": "^4.1.1",
|