feat(apigateway): FTRS-861 - Add route to byTriageCode Lambda#999
feat(apigateway): FTRS-861 - Add route to byTriageCode Lambda#999gurinder-s-brar wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
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_lambdaTerraform module wiring and S3 artefact lookup for atriage-code-lambda.zip. - Update
dos-searchREADME 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. |
| - `GET /TriageCode` will use one Lambda (`endpoints/triage_code/handler.py`). | ||
| The handler delegates to the implementation in |
There was a problem hiding this comment.
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.
| - `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 |
There was a problem hiding this comment.
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.
| description = "This lambda provides search logic to return endpoints by triage code" | ||
| handler = "endpoints/triage_code/handler.lambda_handler" | ||
| runtime = var.lambda_runtime |
There was a problem hiding this comment.
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.
| number_of_policy_jsons = "2" | ||
| policy_jsons = [data.aws_iam_policy_document.dynamodb_access_policy.json] |
There was a problem hiding this comment.
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.
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.