diff --git a/infrastructure/modules/eventpub/lambda/eventpub/src/index.js b/infrastructure/modules/eventpub/lambda/eventpub/src/index.js index 742f653..d0cfc8a 100644 --- a/infrastructure/modules/eventpub/lambda/eventpub/src/index.js +++ b/infrastructure/modules/eventpub/lambda/eventpub/src/index.js @@ -30,22 +30,6 @@ function validateEvent(event) { if (!requiredFields.every(field => event.hasOwnProperty(field))) { return false; } - // Check nested data object and its required fields - const dataRequiredFields = [ - 'nhsNumber', - 'delayedFallback', - 'sendingGroupId', - 'clientId', - 'campaignId', - 'supplierStatus', - 'previousSupplierStatus' - ]; - if ( - typeof event.data !== 'object' || - !dataRequiredFields.every(field => event.data.hasOwnProperty(field)) - ) { - return false; - } return true; } diff --git a/infrastructure/modules/lambda/cloudwatch_log_subscription_filter_firehose.tf b/infrastructure/modules/lambda/cloudwatch_log_subscription_filter_firehose.tf index 0e026da..cdf0605 100644 --- a/infrastructure/modules/lambda/cloudwatch_log_subscription_filter_firehose.tf +++ b/infrastructure/modules/lambda/cloudwatch_log_subscription_filter_firehose.tf @@ -1,6 +1,6 @@ resource "aws_cloudwatch_log_subscription_filter" "firehose" { count = var.send_to_firehose ? 1 : 0 # Keeping this optional for now as don't want to break all lambdas using this, can make this mandatory later - name = replace(aws_cloudwatch_log_group.main.name, "/", "-") + name = trim(replace(aws_cloudwatch_log_group.main.name, "/", "-"), "-") log_group_name = aws_cloudwatch_log_group.main.name filter_pattern = var.filter_pattern destination_arn = var.log_destination_arn