-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/ccm 12951 Switch letter_status_update lambda to use eventsub SNS topic #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d74a0bd
Switch letter_status_update lambda to use eventsub SNS topic
stevebux aabf50d
Introduce idempotency: replayed update with same ID will be ignored
stevebux 966f6eb
Store previous status
stevebux e5b9274
Merge branch 'main' into feature/CCM-12951-Maintain-Letter-Status
stevebux 69e3907
Add missing test following merge with main
stevebux 7dd6cea
Bump test version
stevebux a93033c
Re-enable event auditing
stevebux 92b45c7
CVE-2026-25547
nhsd-david-wass 9519c3d
Merge branch 'main' into feature/CCM-12951-Maintain-Letter-Status
stevebux d11f96f
Post merge clean up
stevebux e5daaef
Merge remote-tracking branch 'origin/main' into feature/CCM-12951-Mai…
stevebux 6e27c49
Upgrade event schema version
stevebux 630d113
Renamed queue and lambda
stevebux 887fe3a
Removed moved blocks, keep existing queue but starve it
stevebux e7aff9a
Merge branch 'main' into feature/CCM-12951-Maintain-Letter-Status
stevebux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
infrastructure/terraform/components/api/event_source_mapping_status_updates_to_handler.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| resource "aws_lambda_event_source_mapping" "status_updates_sqs_to_status_update_handler" { | ||
| event_source_arn = module.letter_status_updates_queue.sqs_queue_arn | ||
| function_name = module.letter_status_update.function_arn | ||
| event_source_arn = module.amendments_queue.sqs_queue_arn | ||
| function_name = module.amendment_event_transformer.function_arn | ||
| batch_size = 10 | ||
| maximum_batching_window_in_seconds = 1 | ||
| scaling_config { maximum_concurrency = 10 } | ||
|
|
||
| depends_on = [ | ||
| module.letter_status_updates_queue, # ensures queue exists | ||
| module.letter_status_update # ensures update handler exists | ||
| module.amendments_queue, # ensures queue exists | ||
| module.amendment_event_transformer # ensures update handler exists | ||
| ] | ||
| } |
9 changes: 9 additions & 0 deletions
9
infrastructure/terraform/components/api/lambda_event_source_mapping_letter_status_update.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| resource "aws_lambda_event_source_mapping" "amendment_event_transformer" { | ||
| event_source_arn = module.amendments_queue.sqs_queue_arn | ||
| function_name = module.amendment_event_transformer.function_name | ||
| batch_size = 10 | ||
| maximum_batching_window_in_seconds = 5 | ||
| function_response_types = [ | ||
| "ReportBatchItemFailures" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...s/api/module_sqs_letter_status_updates.tf → ...m/components/api/module_sqs_amendments.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Moved blocks to handle resource renames without destroy/recreate | ||
|
|
||
| moved { | ||
| from = module.letter_status_updates_queue | ||
| to = module.amendments_queue | ||
| } | ||
|
|
||
| moved { | ||
| from = module.letter_status_update | ||
| to = module.amendment_event_transformer | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.