Skip to content

CCM-16644: Add an eventsub Module#189

Closed
gareth-allan wants to merge 2 commits intomainfrom
feature/CCM-16644_create_eventsub_module
Closed

CCM-16644: Add an eventsub Module#189
gareth-allan wants to merge 2 commits intomainfrom
feature/CCM-16644_create_eventsub_module

Conversation

@gareth-allan
Copy link
Copy Markdown
Contributor

@gareth-allan gareth-allan commented Apr 27, 2026

Description

Add the eventsub module from nhs-notify-supplier-api so that it can also be used in the reporting domain.

download

Context

The reporting domain needs to use the same pattern for subscribing to events from the shared event bus as the Supplier API already uses, and given that the supplier API already includes a Terraform module to implement this pattern, it makes sense to extract that module here to allow for reuse.

Validation

I used the new eventsub module in this PR in the nhs-notify-reporting repository: NHSDigital/nhs-notify-reporting#242

I then deployed this branch of nhs-notify-reporting: https://github.com/NHSDigital/nhs-notify-internal/actions/runs/25057676077

Deployed Resources

SNS Topic:
Screenshot 2026-04-28 at 17 01 53

Firehose Stream:
Screenshot 2026-04-28 at 17 02 07

S3 Bucket:
Screenshot 2026-04-28 at 17 02 14

Glue Crawler:
Screenshot 2026-04-28 at 17 10 04

Sending a Test Message

I then published a test message to the SNS topic:
Screenshot 2026-04-28 at 17 04 06

Eventually, a file appeared in the S3 bucket:
Screenshot 2026-04-28 at 17 14 12

The content of the file was as follows (formatted for readability):

{
  "Type": "Notification",
  "MessageId": "00cfc587-9975-5cf8-be5c-a7ed45c5edc7",
  "TopicArn": "arn:aws:sns:eu-west-2:381492132479:nhs-notify-main-reporting-eventsub",
  "Subject": "test",
  "Message": "{\n  \"test\": \"This is a test\"\n}",
  "Timestamp": "2026-04-28T16:04:00.169Z",
  "UnsubscribeURL": "https://sns.eu-west-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-2:381492132479:nhs-notify-main-reporting-eventsub:82b03e51-7e7b-4d17-8ee8-8ab025ba56c8"
}

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

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.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@gareth-allan gareth-allan changed the title CCM-16644: Add the eventsub module CCM-16644: Add an eventsub Module Apr 27, 2026
@gareth-allan gareth-allan marked this pull request as ready for review April 28, 2026 16:17
@gareth-allan gareth-allan requested a review from a team as a code owner April 28, 2026 16:17
@gareth-allan gareth-allan requested a review from masl2 April 28, 2026 16:17
@gareth-allan
Copy link
Copy Markdown
Contributor Author

It's been agreed that the reporting domain does not need to use the eventsub module, so I'm closing this PR. I don't think there's value in extracting the module from the supplier-api unless we know it's needed elsewhere.

@gareth-allan gareth-allan deleted the feature/CCM-16644_create_eventsub_module branch May 1, 2026 10:40
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.

1 participant