Skip to content

Add TF Config and Index Lambda Extension#546

Open
bamader wants to merge 2 commits into
mainfrom
extend-index-lambda
Open

Add TF Config and Index Lambda Extension#546
bamader wants to merge 2 commits into
mainfrom
extend-index-lambda

Conversation

@bamader
Copy link
Copy Markdown
Collaborator

@bamader bamader commented May 12, 2026

Description

This PR manages the terraform and the index lambda portion of creating a result cache for previously seen eICR inputs. In terraform, this change set includes:

  • Adding a new environment variable for the result cache
  • Creating a bootstrap function for the result cache index to initialize
  • Adding the result cache bootstrap as a dependency to the pipeline
  • Updating documentation (as well as spikes which reference the index procedures)

In the Index Lambda, this PR extends the existing functionality to also apply to the Result Cache index by defining some new actions (basically just counterparts of the Vector Search Index) and re-using functions there. Unit tests are updated and new tests are added accordingly.

Finally, our Index Lambda previously had a set of kruft code which was a carryover from our very first embedding trial. The block of code dealing with checking whether the OpenSearch Index had knn vectors in its property mappings (in the create function) is now no longer necessary: (1) the result cache index does not use KNN embeddings, and (2) (more importantly) the only reason this code was originally there is because our first AWS index upload back in September of 2025 did not have this property set correctly for some of its vectors. When we went to create the index, we had to do an additional check to see whether the index first needed to be deleted so things could be freshly set. Now, though, all of our vectors have the same uniform properties set, so this is a non-issue and will not be a problem going forward. The unit test dealing with this behavior has also been deleted.

Related Issues

Partially addresses some tasks in #533 .

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.75%. Comparing base (9f49739) to head (317c06b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/index-lambda/src/index_lambda/lambda_function.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #546      +/-   ##
==========================================
- Coverage   95.81%   95.75%   -0.07%     
==========================================
  Files          46       46              
  Lines        2344     2378      +34     
==========================================
+ Hits         2246     2277      +31     
- Misses         98      101       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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