@guardian/cdk 59.3.2 → 59.3.4
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,4 +1,4 @@
|
|
|
1
|
-
import type { Schedule } from "aws-cdk-lib/aws-events";
|
|
1
|
+
import type { RuleTargetInput, Schedule } from "aws-cdk-lib/aws-events";
|
|
2
2
|
import type { GuLambdaErrorPercentageMonitoringProps, NoMonitoring } from "../constructs/cloudwatch";
|
|
3
3
|
import type { GuStack } from "../constructs/core";
|
|
4
4
|
import { GuLambdaFunction } from "../constructs/lambda";
|
|
@@ -19,6 +19,10 @@ export interface GuScheduledLambdaProps extends Omit<GuFunctionProps, "errorPerc
|
|
|
19
19
|
* Optional description.
|
|
20
20
|
*/
|
|
21
21
|
description?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional input
|
|
24
|
+
*/
|
|
25
|
+
input?: RuleTargetInput;
|
|
22
26
|
}>;
|
|
23
27
|
/**
|
|
24
28
|
* Monitoring configuration for the lambda.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-lambda.d.ts","sourceRoot":"","sources":["../../src/patterns/scheduled-lambda.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduled-lambda.d.ts","sourceRoot":"","sources":["../../src/patterns/scheduled-lambda.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,KAAK,EAAE,sCAAsC,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,eAAe,EAAE,2BAA2B,CAAC;IAChG;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;QACX;;;;;WAKG;QACH,QAAQ,EAAE,QAAQ,CAAC;QACnB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB;;WAEG;QACH,KAAK,CAAC,EAAE,eAAe,CAAC;KACzB,CAAC,CAAC;IACH;;;;OAIG;IACH,uBAAuB,EAAE,YAAY,GAAG,sCAAsC,CAAC;CAChF;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;gBACzC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB;CAmBtE"}
|
|
@@ -22,7 +22,7 @@ class GuScheduledLambda extends lambda_1.GuLambdaFunction {
|
|
|
22
22
|
const resourceToInvoke = this.alias ?? this;
|
|
23
23
|
new aws_events_1.Rule(this, `${id}-${rule.schedule.expressionString}-${index}`, {
|
|
24
24
|
schedule: rule.schedule,
|
|
25
|
-
targets: [new aws_events_targets_1.LambdaFunction(resourceToInvoke)],
|
|
25
|
+
targets: [new aws_events_targets_1.LambdaFunction(resourceToInvoke, { event: rule.input })],
|
|
26
26
|
...(rule.description && { description: rule.description }),
|
|
27
27
|
enabled: true,
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-lambda.js","sourceRoot":"","sources":["../../src/patterns/scheduled-lambda.ts"],"names":[],"mappings":";;;AAAA,uDAA8C;AAE9C,uEAAgE;AAGhE,iDAAwD;
|
|
1
|
+
{"version":3,"file":"scheduled-lambda.js","sourceRoot":"","sources":["../../src/patterns/scheduled-lambda.ts"],"names":[],"mappings":";;;AAAA,uDAA8C;AAE9C,uEAAgE;AAGhE,iDAAwD;AAgCxD;;;;GAIG;AACH,MAAa,iBAAkB,SAAQ,yBAAgB;IACrD,YAAY,KAAc,EAAE,EAAU,EAAE,KAA6B;QACnE,MAAM,WAAW,GAAoB;YACnC,GAAG,KAAK;YACR,yBAAyB,EAAE,KAAK,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,uBAAuB;SAClH,CAAC;QACF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QAE9B,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAClC,0GAA0G;YAC1G,0DAA0D;YAC1D,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC;YAC5C,IAAI,iBAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,IAAI,KAAK,EAAE,EAAE;gBACjE,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,OAAO,EAAE,CAAC,IAAI,mCAAc,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBACtE,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC1D,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AApBD,8CAoBC","sourcesContent":["import { Rule } from \"aws-cdk-lib/aws-events\";\nimport type { RuleTargetInput, Schedule } from \"aws-cdk-lib/aws-events\";\nimport { LambdaFunction } from \"aws-cdk-lib/aws-events-targets\";\nimport type { GuLambdaErrorPercentageMonitoringProps, NoMonitoring } from \"../constructs/cloudwatch\";\nimport type { GuStack } from \"../constructs/core\";\nimport { GuLambdaFunction } from \"../constructs/lambda\";\nimport type { GuFunctionProps } from \"../constructs/lambda\";\n\nexport interface GuScheduledLambdaProps extends Omit<GuFunctionProps, \"errorPercentageMonitoring\"> {\n /**\n * Schedule(s) for the lambda task.\n */\n rules: Array<{\n /**\n * E.g.:\n *\n * - `Schedule.expression(\"cron(0 8 ? * MON-FRI *)\")`\n * - `Schedule.rate(Duration.minutes(5))`\n */\n schedule: Schedule;\n /**\n * Optional description.\n */\n description?: string;\n /**\n * Optional input\n */\n input?: RuleTargetInput;\n }>;\n /**\n * Monitoring configuration for the lambda.\n *\n * Opting-out via the `NoMonitoring` type is supported but discouraged.\n */\n monitoringConfiguration: NoMonitoring | GuLambdaErrorPercentageMonitoringProps;\n}\n\n/**\n * Pattern which creates all of the resources needed to invoke a lambda function on a schedule.\n *\n * For all configuration options, see [[`GuScheduledLambdaProps`]].\n */\nexport class GuScheduledLambda extends GuLambdaFunction {\n constructor(scope: GuStack, id: string, props: GuScheduledLambdaProps) {\n const lambdaProps: GuFunctionProps = {\n ...props,\n errorPercentageMonitoring: props.monitoringConfiguration.noMonitoring ? undefined : props.monitoringConfiguration,\n };\n super(scope, id, lambdaProps);\n\n props.rules.forEach((rule, index) => {\n // If we have an alias, use this to ensure that all invocations are handled by a published Lambda version.\n // Otherwise, use the latest unpublished version ($LATEST)\n const resourceToInvoke = this.alias ?? this;\n new Rule(this, `${id}-${rule.schedule.expressionString}-${index}`, {\n schedule: rule.schedule,\n targets: [new LambdaFunction(resourceToInvoke, { event: rule.input })],\n ...(rule.description && { description: rule.description }),\n enabled: true,\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": "59.3.
|
|
4
|
+
"version": "59.3.4",
|
|
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.27.
|
|
31
|
+
"@changesets/cli": "2.27.8",
|
|
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.5.
|
|
41
|
+
"@types/node": "22.5.3",
|
|
42
42
|
"@types/yargs": "^17.0.33",
|
|
43
43
|
"aws-cdk": "2.155.0",
|
|
44
44
|
"aws-cdk-lib": "2.155.0",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@oclif/core": "3.26.6",
|
|
59
|
-
"aws-sdk": "^2.
|
|
59
|
+
"aws-sdk": "^2.1691.0",
|
|
60
60
|
"chalk": "^4.1.2",
|
|
61
61
|
"codemaker": "^1.103.1",
|
|
62
|
-
"git-url-parse": "^
|
|
62
|
+
"git-url-parse": "^15.0.0",
|
|
63
63
|
"js-yaml": "^4.1.0",
|
|
64
64
|
"lodash.camelcase": "^4.3.0",
|
|
65
65
|
"lodash.kebabcase": "^4.1.1",
|