Skip to content

Commit 087a895

Browse files
Merge pull request #96 from NHSDigital/feature/CCM-11097_Event_Validation
CCM-11097: Event Validation
2 parents eee26d2 + fb8d917 commit 087a895

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

infrastructure/modules/eventpub/lambda/eventpub/src/index.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,6 @@ function validateEvent(event) {
3030
if (!requiredFields.every(field => event.hasOwnProperty(field))) {
3131
return false;
3232
}
33-
// Check nested data object and its required fields
34-
const dataRequiredFields = [
35-
'nhsNumber',
36-
'delayedFallback',
37-
'sendingGroupId',
38-
'clientId',
39-
'campaignId',
40-
'supplierStatus',
41-
'previousSupplierStatus'
42-
];
43-
if (
44-
typeof event.data !== 'object' ||
45-
!dataRequiredFields.every(field => event.data.hasOwnProperty(field))
46-
) {
47-
return false;
48-
}
4933
return true;
5034
}
5135

infrastructure/modules/lambda/cloudwatch_log_subscription_filter_firehose.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
resource "aws_cloudwatch_log_subscription_filter" "firehose" {
22
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
3-
name = replace(aws_cloudwatch_log_group.main.name, "/", "-")
3+
name = trim(replace(aws_cloudwatch_log_group.main.name, "/", "-"), "-")
44
log_group_name = aws_cloudwatch_log_group.main.name
55
filter_pattern = var.filter_pattern
66
destination_arn = var.log_destination_arn

0 commit comments

Comments
 (0)