Skip to content

Chore: [AEA-0000] - Optionaly use imports in lambda constructs#603

Merged
anthony-nhs merged 4 commits intomainfrom
optional_use_imports_in_lambda
Mar 17, 2026
Merged

Chore: [AEA-0000] - Optionaly use imports in lambda constructs#603
anthony-nhs merged 4 commits intomainfrom
optional_use_imports_in_lambda

Conversation

@anthony-nhs
Copy link
Contributor

Summary

  • Routine Change

Details

  • Allow passing new params to lambda constructs to bypass using imports

@github-actions
Copy link
Contributor

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-0000

Copilot AI review requested due to automatic review settings March 17, 2026 17:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sonarqubecloud
Copy link

@anthony-nhs anthony-nhs merged commit cc10f07 into main Mar 17, 2026
16 checks passed
@anthony-nhs anthony-nhs deleted the optional_use_imports_in_lambda branch March 17, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants