Skip to content

Conversation

@eddalmond1
Copy link
Collaborator

Description

https://nhsd-jira.digital.nhs.uk/browse/ELI-304

Adding the means to forward on Cloudwatch alerts to ITOC Splunk

Context

We want close monitoring of actual issues, without exposing PID / other information to a team who don't need that information

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.

target_key_id = aws_kms_key.firehose_splunk_cmk.key_id
}

resource "aws_kinesis_firehose_delivery_stream" "splunk_delivery_stream" {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This part of the code is basically setting up a new Firehose Stream with the Splunk endpoint. The module doesn't deal with getting logs/alarms into Firehose, that's dealt with in the main stack (via eventbridge.tf)

hec_endpoint_type = "Event"
s3_backup_mode = "FailedEventsOnly"

s3_configuration {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note this bit - if we fail to deliver a record to Splunk, then we put it in a bucket for further investigation. We could add an alarm for this, so it's called out both on our console and in ITOC splunk, but will leave that to a future ticket.

role_arn = aws_iam_role.eventbridge_firehose_role.arn

# Transform the CloudWatch alarm event into a format suitable for Splunk
input_transformer {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've left the transformation pretty minimal, as I think we'd want ITOC to feed back on 'version 1' of these logs to their Splunk.

eddalmond1 and others added 20 commits August 13, 2025 12:06
* provisioned concurrency

* enable dead letter queue

* enhanced monitoring

* lambda function versioning

* provison concurrancy - alias version fix

* removed checkov as we implemented dead letter queue

* prod conditions and github roles

* github roles

* fix for corrupt kms policy

* create queue

* get the latest function for concurrant provisioning
* lambda versioning for provisioned concurrency

* dlq is not for RequestResponse (sync)

* checkov skip for dlq
Copy link
Contributor

@robbailiff2 robbailiff2 left a comment

Choose a reason for hiding this comment

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

Had a good look through and it looks good to me.

@eddalmond1 eddalmond1 merged commit 8a677c9 into main Aug 22, 2025
22 checks passed
@eddalmond1 eddalmond1 deleted the feature/eja-eli-304-push-cloudwatch-alarms-to-itoc-splunk branch August 22, 2025 14:31
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.

3 participants