Skip to content

feat(apigateway): FTRS-861 - Add route to byTriageCode Lambda#999

Draft
gurinder-s-brar wants to merge 3 commits intomainfrom
task/FTRS-861_Add-route-to-triagecode-lambda
Draft

feat(apigateway): FTRS-861 - Add route to byTriageCode Lambda#999
gurinder-s-brar wants to merge 3 commits intomainfrom
task/FTRS-861_Add-route-to-triagecode-lambda

Conversation

@gurinder-s-brar
Copy link
Contributor

Description

Context

https://nhsd-jira.digital.nhs.uk/browse/FTRS-861

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.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

Copilot AI review requested due to automatic review settings March 9, 2026 12:57
Copy link
Contributor

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

Adds infrastructure and documentation to expose a new /TriageCode API Gateway route in the dos-search stack, backed by a dedicated “triage code” Lambda artefact.

Changes:

  • Add API Gateway REST resource + GET/POST methods/integrations for /TriageCode.
  • Introduce a new triage_code_lambda Terraform module wiring and S3 artefact lookup for a triage-code-lambda.zip.
  • Update dos-search README and stack variables/tfvars to describe/configure the new Lambda.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
services/dos-search/README.md Documents the intended Lambda-per-endpoint layout and adds /TriageCode notes.
infrastructure/stacks/dos_search/variables.tf Adds triage_code_lambda_name and build_splunk_subscription variables for the stack.
infrastructure/stacks/dos_search/triage_code_lambda.tf Creates the triage-code Lambda module configuration and runtime settings.
infrastructure/stacks/dos_search/data.tf Adds S3 object lookup for the triage-code Lambda package.
infrastructure/stacks/dos_search/api-gateway-rest-resource-triage-code.tf Defines /TriageCode resource and GET/POST proxy integrations.
infrastructure/stacks/dos_search/api-gateway-rest-deployment.tf Ensures API Gateway deployment is updated when triage-code resources change.
infrastructure/dos_search.tfvars Provides the triage_code_lambda_name value for deployments using this tfvars file.

Comment on lines +79 to +80
- `GET /TriageCode` will use one Lambda (`endpoints/triage_code/handler.py`).
The handler delegates to the implementation in
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The bullet says GET /TriageCode but the endpoint is configured to accept both GET and POST (and the text below also says it supports GET and POST). Update the bullet to reflect both methods to avoid misleading readers.

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +83
- `GET /TriageCode` will use one Lambda (`endpoints/triage_code/handler.py`).
The handler delegates to the implementation in
`endpoints/triage_code/triage_code_function.py`.
Implementation note: the active TriageCode endpoint logic lives in
`endpoints/triage_code/triage_code_function.py` (it exposes the
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The README references endpoints/triage_code/handler.py and endpoints/triage_code/triage_code_function.py, but there is no services/dos-search/endpoints/ directory in the repository (current code lives under functions/ and health_check/). Either add the referenced endpoint modules (and packaging) or update this section to match the actual code layout so the handler paths are actionable.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +6
description = "This lambda provides search logic to return endpoints by triage code"
handler = "endpoints/triage_code/handler.lambda_handler"
runtime = var.lambda_runtime
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The Lambda handler is set to endpoints/triage_code/handler.lambda_handler, but this repo currently has no services/dos-search/endpoints/triage_code/ module. If the deployment artifact is built from this repository, this handler value will cause runtime import errors. Align the handler string with the actual module path included in the triage-code Lambda zip, or add the missing handler module to the service codebase/build.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +14
number_of_policy_jsons = "2"
policy_jsons = [data.aws_iam_policy_document.dynamodb_access_policy.json]
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

number_of_policy_jsons is passed to the ../../modules/lambda module, but that module computes number_of_policy_jsons internally from local.additional_json_policies and does not use the input variable. Removing this argument from the new triage-code Lambda module call avoids confusion about which value is authoritative.

Copilot uses AI. Check for mistakes.
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