-
Notifications
You must be signed in to change notification settings - Fork 4
NRL-1386 Add infra and config for prod dashboards #937
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
mattdean3-nhs
merged 29 commits into
develop
from
feature/made14-NRL-1386-prod-dashboards-infra
Jun 30, 2025
Merged
Changes from 16 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c3c803a
NRL-1479 update firehose buffer time for quicker testing
jackleary aca8513
NRL-1479 update logging set up
jackleary 67152e7
NRL-1479 Update logging
jackleary da6b10d
NRL-1479 Update iam role to allow notebooks to run
jackleary 2c6322c
NRL-1479 Update logging and lower all columns before writing to parquet
jackleary cfa08a5
[NRL-1386] Add reporting infra to all envs
mattdean3-nhs 7a34959
NRL-1479 Add views as saved queries
jackleary 9cf8f54
NRL-1479 Add athena views to deployment
jackleary 53acc81
[NRL-1386] Rename ec2 module, add toggle for powerbi gw deploy.
mattdean3-nhs e72cc3a
Merge remote-tracking branch 'origin/feature/jale13-NRL-1479-temp-cha…
mattdean3-nhs 8cdf238
[NRL-1386] Revert unwanted firehose buffering change
mattdean3-nhs 910dd30
[NRL-1386] WIP Fixup powerbi gw TF prov issues
mattdean3-nhs 0e8116a
[NRL-1386] Add missing glue_database to test+prod. Fix TF apply state…
mattdean3-nhs b25f569
[NRL-1386] Fix glue source bucket lifecycle auto-deletes
mattdean3-nhs 950d036
[NRL-1386] Add var to enable/disable all reporting services per env a…
mattdean3-nhs e73a0c6
[NRL-1386] Don't provision infra firehose streams for ephem envs
mattdean3-nhs 8ef6f0a
[NRL-1386] Enable reporting infra in dev by default
mattdean3-nhs b56610a
[NRL-1386] Fix TF bug in infra with firehose__processor
mattdean3-nhs f75a740
[NRL-1386] Switch lambda subscriptions to a named map
mattdean3-nhs a5dc5be
[NRL-1386] Re-worded flag TF var descr. Removed unused powerbi-gw mod…
mattdean3-nhs 5ef6668
Merge remote-tracking branch 'origin/develop' into feature/made14-NRL…
mattdean3-nhs 15263c7
[NRL-1386] Fix SNS notifications for backup source
mattdean3-nhs 43b2e4e
[NRL-1386] Remove env-specific reporting infra from account-wide
mattdean3-nhs 73bae58
NRL-1386 Increase EC2 storage to allow standard gw set up
jackleary 157a145
NRL-1386 Remove unused col in views
jackleary 2dad8a1
NRL-1386 group small files together
jackleary 3f1315d
NRL-1386 Update group size to 128mb
jackleary 37005d4
NRL-1386 Update readme with updated instructions for standard gw inst…
jackleary 02eff29
[NRL-1386] Make lambda subscription filters unique per firehose stream
mattdean3-nhs 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| module "dev-athena" { | ||
| count = var.enable_reporting ? 1 : 0 | ||
| source = "../modules/athena" | ||
| name_prefix = "nhsd-nrlf--dev" | ||
| target_bucket_name = module.dev-glue.target_bucket_name | ||
| glue_database = module.dev-glue.glue_database | ||
| } |
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
123 changes: 123 additions & 0 deletions
123
terraform/account-wide-infrastructure/modules/athena/sql/rep_consumer.sql
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,123 @@ | ||
| CREATE OR REPLACE VIEW "rep_consumer" AS | ||
| WITH | ||
| cc AS ( | ||
| SELECT | ||
| time | ||
| , event_timestamp | ||
| , date | ||
| , host | ||
| , event_log_reference | ||
| , event_level | ||
| , event_location | ||
| , event_message | ||
| , event_service | ||
| , event_function_request_id | ||
| , event_correlation_id | ||
| , event_xray_trace_id | ||
| , event_pointer_types | ||
| , '' event_custodian | ||
| , COALESCE("event_headers_nhsd-end-user-organisation-ods", event_metadata_ods_code) user_ods | ||
| FROM | ||
| consumer_countdocumentreference | ||
| ) | ||
| , cr AS ( | ||
| SELECT | ||
| time | ||
| , event_timestamp | ||
| , date | ||
| , host | ||
| , event_log_reference | ||
| , event_level | ||
| , event_location | ||
| , event_message | ||
| , event_service | ||
| , event_function_request_id | ||
| , event_correlation_id | ||
| , event_xray_trace_id | ||
| , event_pointer_types | ||
| , event_custodian | ||
| , COALESCE("event_headers_nhsd-end-user-organisation-ods", event_metadata_ods_code) user_ods | ||
| FROM | ||
| consumer_readdocumentreference | ||
| ) | ||
| , cs AS ( | ||
| SELECT | ||
| time | ||
| , event_timestamp | ||
| , date | ||
| , host | ||
| , event_log_reference | ||
| , event_level | ||
| , event_location | ||
| , event_message | ||
| , event_service | ||
| , event_function_request_id | ||
| , event_correlation_id | ||
| , event_xray_trace_id | ||
| , event_pointer_types | ||
| , event_custodian | ||
| , COALESCE("event_headers_nhsd-end-user-organisation-ods", event_metadata_ods_code) user_ods | ||
| FROM | ||
| consumer_searchdocumentreference | ||
| ) | ||
| , csp AS ( | ||
| SELECT | ||
| time | ||
| , event_timestamp | ||
| , date | ||
| , host | ||
| , event_log_reference | ||
| , event_level | ||
| , event_location | ||
| , event_message | ||
| , event_service | ||
| , event_function_request_id | ||
| , event_correlation_id | ||
| , event_xray_trace_id | ||
| , event_pointer_types | ||
| , event_custodian | ||
| , COALESCE("event_headers_nhsd-end-user-organisation-ods", event_metadata_ods_code) user_ods | ||
| FROM | ||
| consumer_searchpostdocumentreference | ||
| ) | ||
| , base AS ( | ||
| SELECT * | ||
| FROM | ||
| cc | ||
| UNION SELECT * | ||
| FROM | ||
| cr | ||
| UNION SELECT * | ||
| FROM | ||
| cs | ||
| UNION SELECT * | ||
| FROM | ||
| csp | ||
| ) | ||
| , ods_codes AS ( | ||
| SELECT DISTINCT | ||
| user_ods | ||
| , event_xray_trace_id | ||
| FROM | ||
| base | ||
| WHERE (user_ods IS NOT NULL) | ||
| ) | ||
| SELECT | ||
| time | ||
| , event_timestamp | ||
| , date | ||
| , host | ||
| , event_log_reference | ||
| , event_level | ||
| , event_location | ||
| , event_message | ||
| , event_service | ||
| , event_function_request_id | ||
| , b.event_correlation_id | ||
| , b.event_xray_trace_id | ||
| , event_pointer_types | ||
| , COALESCE(COALESCE(event_custodian, LAG(event_custodian) IGNORE NULLS OVER (PARTITION BY b.event_xray_trace_id ORDER BY event_timestamp ASC)), COALESCE(event_custodian, LEAD(event_custodian) IGNORE NULLS OVER (PARTITION BY b.event_xray_trace_id ORDER BY event_timestamp ASC))) event_custodian | ||
| , oc.user_ods | ||
| FROM | ||
| (base b | ||
| LEFT JOIN ods_codes oc ON (b.event_xray_trace_id = oc.event_xray_trace_id)) |
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.