Chore: [AEA-0000] - Optionaly use imports in lambda constructs#603
Chore: [AEA-0000] - Optionaly use imports in lambda constructs#603anthony-nhs merged 4 commits intomainfrom
Conversation
|
This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket: AEA-0000 |
There was a problem hiding this comment.
Pull request overview
This PR updates the shared Lambda construct plumbing so consumers can optionally pass in pre-created resources (instead of relying on Fn.importValue imports), and adds test coverage for the new behavior (including disabling the Splunk subscription filter).
Changes:
- Extend shared Lambda resource creation to optionally use provided KMS key / IAM policies / Splunk delivery stream + role, and optionally skip creating the Splunk subscription filter.
- Update TypeScript and Python Lambda constructs to accept/pass-through the new optional props.
- Add tests covering “no subscription filter” and “provided resources (no imports)” scenarios; update dev tooling config to improve TS lint/format experience.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cdkConstructs/src/constructs/lambdaSharedResources.ts | Adds optional props/defaults for shared resources; conditionally creates Splunk subscription filter. |
| packages/cdkConstructs/src/constructs/TypescriptLambdaFunction.ts | Exposes new optional shared-resource props and forwards them into createSharedLambdaResources. |
| packages/cdkConstructs/src/constructs/PythonLambdaFunction.ts | Same as TS construct; forwards new optional shared-resource props into createSharedLambdaResources. |
| packages/cdkConstructs/tests/constructs/typescriptFunctionConstruct.test.ts | Adds tests for addSplunkSubscriptionFilter: false and for passing resources directly (no imports). |
| packages/cdkConstructs/tests/constructs/pythonLambdaFunctionConstruct.test.ts | Adds equivalent tests for the Python construct. |
| .vscode/eps-cdk-utils.code-workspace | Sets ESLint as the default formatter for TypeScript in the workspace. |
| .devcontainer/devcontainer.json | Adds ESLint + Vitest Explorer extensions to the devcontainer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|



Summary
Details