CCM-17343: Add routing of supplier config events to no-op lambda#570
CCM-17343: Add routing of supplier config events to no-op lambda#570stevebux wants to merge 2 commits into
Conversation
86fd099 to
779f02a
Compare
There was a problem hiding this comment.
Pull request overview
Adds the scaffolding to route uk.nhs.notify.supplier-config* events from the eventsub SNS topic into a new SQS queue and on to a placeholder (no-op) Lambda handler, ahead of the real persistence logic being implemented under CCM-17379.
Changes:
- New Terraform:
sqs_supplier_configqueue (with SNS-only send policy), SNS subscription with aMessageBodyprefix filter ontype,supplier_config_ingressLambda module, and an SQS→Lambda event source mapping withReportBatchItemFailures. - New
lambdas/supplier-config-ingressNode package containing a stubsupplierConfigHandlerthat returns{ batchItemFailures: [] }, plus jest/tsconfig/build configuration and a unit test. - Updates
package-lock.jsonand the auto-generated Terraform README to register the new workspace and modules.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| infrastructure/terraform/components/api/module_lambda_supplier_config_ingress.tf | New Lambda module + IAM policy (KMS, SQS receive) for the ingress handler. |
| infrastructure/terraform/components/api/module_sqs_supplier_config.tf | New SQS queue + policy allowing the eventsub SNS topic to publish. |
| infrastructure/terraform/components/api/sns_topic_subscription_eventsub_sqs_supplier_config.tf | Subscribes the queue to eventsub with a type prefix filter. |
| infrastructure/terraform/components/api/lambda_event_source_mapping_supplier_config_ingress.tf | Wires the SQS queue to the Lambda with batched, partial-failure responses. |
| infrastructure/terraform/components/api/README.md | Auto-generated module listing updates. |
| lambdas/supplier-config-ingress/src/index.ts | Placeholder SQS handler returning no failures. |
| lambdas/supplier-config-ingress/src/tests/index.test.ts | Unit test for the placeholder handler. |
| lambdas/supplier-config-ingress/package.json | Package manifest with build/test/lint scripts. |
| lambdas/supplier-config-ingress/jest.config.ts | Jest config (ts-jest ESM, 100% coverage thresholds). |
| lambdas/supplier-config-ingress/tsconfig.json | TS config extending the base, including jest+node types. |
| lambdas/supplier-config-ingress/.gitignore | Ignores build/coverage/node_modules artefacts. |
| package-lock.json | Registers the new workspace. |
a539f03 to
ace4390
Compare
ace4390 to
d4457f8
Compare
| @@ -0,0 +1,78 @@ | |||
|
|
|||
There was a problem hiding this comment.
remove empty lines
d4457f8 to
89ea5d8
Compare
| @@ -0,0 +1,48 @@ | |||
| module "sqs_supplier_config" { | |||
| source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-sqs.zip" | |||
There was a problem hiding this comment.
| source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-sqs.zip" | |
| source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.1.5/terraform-sqs.zip" |
|
|
||
| create_dlq = true | ||
| sqs_policy_overload = data.aws_iam_policy_document.supplier_config_queue_policy.json | ||
| } |
There was a problem hiding this comment.
| } | |
| enable_queue_oldest_message_alarm = false | |
| } |
This turns off the built-in alarm from the shared module - we have our own alarm for this infrastructure/terraform/modules/alarms-sqs/cloudwatch_metric_alarm_age_anomaly.tf. Probably something we should consider removing and opting for the shared one in the near future...
Description
Context
Type of changes
Checklist
DT3-Specific Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.