Skip to content

Feature/safo6 nrl 721 seed sandbox data#1140

Merged
sandyforresternhs merged 36 commits intodevelopfrom
feature/SAFO6-NRL-721-seed-sandbox-data
Mar 2, 2026
Merged

Feature/safo6 nrl 721 seed sandbox data#1140
sandyforresternhs merged 36 commits intodevelopfrom
feature/SAFO6-NRL-721-seed-sandbox-data

Conversation

@sandyforresternhs
Copy link
Contributor

@sandyforresternhs sandyforresternhs commented Feb 10, 2026

  • Deletes all items in a DynamoDB table and reseeds the table with X (default = 2) pointers of each type for X (default is 2) custodians
  • The scripts have been implemented to allow for execution either locally or via the lambda
  • When running locally, the delete_all_table_items.py and seed_sandbox_table.py scripts can be run independently or via the orchestrator script reset_sandbox_table.py
  • The lambda handles the orchestration of the delete and seed scripts (index.py), so the reset_sandbox_table.py script is not required for the lambda
  • The lambda is deployed account-wide to dev and/or test (since we wouldn't want to reseed prod tables) and only when a table in the account has been specified for reseeding
  • Logs showing the lambda working successfully can be seen here
  • Because it's account-wide we have needed to make the lamda layers available in the a/c wide infrastructure

@github-actions
Copy link

💥 Something went wrong while deploying the pull request environment.
Check Output Logs

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 1c7c0abbd7cb49c7aa4d6c482f6dcd6a538d0daa
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 3b56521bd8cc2e70e7282738b296bbdae3c011c1
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 5aebcd6b07f468d3817ba67175ee537d70cc1cfe
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: b49b1af1cd98bbfdfa7726792bee19c0502b7550
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 679fc56f55e5b2de7520013a568ea53d2323722a
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: f33166b75d2cae9edf6235594f9c88a7f15a3c6b
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 37c2c3f9cc99027a28cab4563443751c3718df98
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 56b0592af07503e9aab8c8dbd368ee395a0feb3d
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 012fa4fbf6a2a785d25f1c244be7879e01933d74
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

Copy link
Contributor

@mattdean3-nhs mattdean3-nhs left a comment

Choose a reason for hiding this comment

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

This is EPIC 💪 nice work!

A few passing comments that I'd be happy to ignore.

Only one that we might need to address is the "*" wildcard used on the KMS key access for the new lambda - do we have an option to restrict that?

description = "Rule to clear and reseed sandbox data"
# Set this to weekly once development and testing is complete
# schedule_expression = "cron(0 2 ? * SUN *)" # 2am UTC, every Sunday
schedule_expression = "cron(0/15 9-17 ? * MON-FRI *)" # Every 15 minutes, 9am-5pm UTC, Monday-Friday
Copy link
Contributor

Choose a reason for hiding this comment

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

worth making this schedule a module var? that way we could have different schedules for dev and test if we want. Not sure if it's worth it though, up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great call, yep will do that 👍

"kms:Decrypt",
"kms:DescribeKey"
]
Resource = "*"
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have an option to restrict this to a specific key? rather than all keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, let's do that 👍

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 1938493df29f9fd8513c7464c47733e97bbf4fe1
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 908c6b6832880c8c4ae7b92b2ed166d1c23bcce2
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: d24e6f0333b7e49331b8e143b9f67a71c133d11a
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@sonarqubecloud
Copy link

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: a3de6e154b39a32d7fe67fa2c0abbeebad14442e
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

🚀 PR environment successfully deployed.
Commit Hash: 8c698229b47c4dd4984a097d20e9d5b27f82db91
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

🚀 PR environment successfully deployed.
Commit Hash: 9e9ca25682f822d84f1935e81e7b6d0b64d07ed9
URL: https://nrl721-01ba47.api.record-locator.dev.national.nhs.uk/

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.

4 participants