Skip to content
Merged
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
973aa1f
added v2 lambdas and sqs queue update
samfallowfield Aug 18, 2025
deb0ed7
updated feature flags to add flag for v2BulkUploadLambdaEnabled
samfallowfield Aug 18, 2025
10f59f4
removed duplicate names
samfallowfield Aug 18, 2025
da88bf2
PRMT-574 updated queues.tf and vt bulk upload
samfallowfield Aug 18, 2025
937596f
PRMT-574 update feature flag name
samfallowfield Aug 18, 2025
b2bee53
PRMT-574 update to only deploy V2 to deploy to sandboxes or dev curre…
samfallowfield Aug 20, 2025
a26221f
PRMT-574 applied formatting
samfallowfield Aug 20, 2025
ae27558
PRMT-574 updated Count for deployment
samfallowfield Aug 20, 2025
c833d92
PRMT-574 type fix
samfallowfield Aug 20, 2025
c524a7b
PRMT-574 updated to include list index
samfallowfield Aug 20, 2025
efe0316
PRMT-574 updated to include list index
samfallowfield Aug 20, 2025
c468157
Merge branch 'main' into PRMT-574
MohammadIqbalAD-NHS Aug 20, 2025
9cf94c6
PRMT-574 Remove outdated VAR
samfallowfield Aug 21, 2025
e95da1e
Merge remote-tracking branch 'origin/PRMT-574' into PRMT-574
samfallowfield Aug 21, 2025
96643c9
[PRMT-575] - Modify V2 lambdas to use V2 handlers
MohammadIqbalAD-NHS Aug 27, 2025
daa69c3
PRMT-574 Created resources for toggle V2 Bulk upload lambda
samfallowfield Aug 28, 2025
21dd4ed
PRMT-574 remove reliance on unneeded handler
samfallowfield Aug 28, 2025
eb4a1e2
Merge branch 'PRMT-574' of github.com:nhsconnect/national-document-re…
samfallowfield Aug 28, 2025
6eb5653
PRMT-574 Added limit to only deploy toggle as far as dev
samfallowfield Aug 29, 2025
8454b51
PRMT-574 update format
samfallowfield Sep 2, 2025
258452d
PRMT-574 list fix
samfallowfield Sep 2, 2025
0f24173
[PRMT-575] - Add lambda DynamoDB environment variables
MohammadIqbalAD-NHS Sep 2, 2025
c55b71d
[PRMT-575] - Remove duplicate resources other than V2 Lambda
MohammadIqbalAD-NHS Sep 10, 2025
1b966fc
Merge branch 'main' into PRMT-575
MohammadIqbalAD-NHS Sep 11, 2025
84ca69a
[PRMT-575] - Re-add toggle lambda iam policy
MohammadIqbalAD-NHS Sep 11, 2025
5d9b233
[PRMT-575] - Add environment variable and iam permissions for V2 lambda
MohammadIqbalAD-NHS Sep 11, 2025
e03caee
[PRMT-575] - Add permission to interact with bulkUploadReport table
MohammadIqbalAD-NHS Sep 12, 2025
a6ae625
[PRMT-575] - Undo line change
MohammadIqbalAD-NHS Sep 15, 2025
b72b29d
Merge branch 'main' into PRMT-575
MohammadIqbalAD-NHS Sep 15, 2025
000060f
[PRMT-575] - Rename lambda resources
MohammadIqbalAD-NHS Sep 16, 2025
cd51d63
Merge branch 'main' into PRMT-575
MohammadIqbalAD-NHS Sep 24, 2025
b0a4df3
Merge branch 'main' into PRMT-575
MohammadIqbalAD-NHS Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions infrastructure/lambda-bulk-upload-metadata-processor.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
module "bulk-upload-metadata-processor-lambda" {
source = "./modules/lambda"
name = "BulkUploadMetadataProcessor"
handler = "handlers.bulk_upload_metadata_processor_handler.lambda_handler"
lambda_timeout = 900
memory_size = 1769
iam_role_policy_documents = [
module.ndr-bulk-staging-store.s3_read_policy_document,
module.ndr-bulk-staging-store.s3_write_policy_document,
module.bulk_upload_report_dynamodb_table.dynamodb_read_policy_document,
module.bulk_upload_report_dynamodb_table.dynamodb_write_policy_document,
module.sqs-lg-bulk-upload-metadata-queue.sqs_read_policy_document,
module.sqs-lg-bulk-upload-metadata-queue.sqs_write_policy_document,
module.ndr-app-config.app_config_policy
]

rest_api_id = null
api_execution_arn = null

lambda_environment_variables = {
APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id
APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
WORKSPACE = terraform.workspace
STAGING_STORE_BUCKET_NAME = "${terraform.workspace}-${var.staging_store_bucket_name}"
BULK_UPLOAD_DYNAMODB_NAME = "${terraform.workspace}_${var.bulk_upload_report_dynamodb_table_name}"
LLOYD_GEORGE_BUCKET_NAME = "${terraform.workspace}-${var.lloyd_george_bucket_name}"
LLOYD_GEORGE_DYNAMODB_NAME = "${terraform.workspace}_${var.lloyd_george_dynamodb_table_name}"
Comment thread
MohammadIqbalAD-NHS marked this conversation as resolved.
METADATA_SQS_QUEUE_URL = module.sqs-lg-bulk-upload-metadata-queue.sqs_url
}
is_gateway_integration_needed = false
is_invoked_from_gateway = false
}

module "bulk-upload-metadata-processor-alarm" {
source = "./modules/lambda_alarms"
lambda_function_name = module.bulk-upload-metadata-processor-lambda.function_name
lambda_timeout = module.bulk-upload-metadata-processor-lambda.timeout
lambda_name = "bulk_upload_metadata_processor_handler"
namespace = "AWS/Lambda"
alarm_actions = [module.bulk-upload-metadata-processor-alarm-topic.arn]
ok_actions = [module.bulk-upload-metadata-processor-alarm-topic.arn]
depends_on = [module.bulk-upload-metadata-processor-lambda, module.bulk-upload-metadata-processor-alarm-topic]
}

module "bulk-upload-metadata-processor-alarm-topic" {
source = "./modules/sns"
sns_encryption_key_id = module.sns_encryption_key.id
topic_name = "bulk-upload-metadata-processor-topic"
topic_protocol = "lambda"
topic_endpoint = module.bulk-upload-metadata-processor-lambda.lambda_arn
delivery_policy = jsonencode({
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Principal" : {
"Service" : "cloudwatch.amazonaws.com"
},
"Action" : [
"SNS:Publish",
],
"Condition" : {
"ArnLike" : {
"aws:SourceArn" : "arn:aws:cloudwatch:eu-west-2:${data.aws_caller_identity.current.account_id}:alarm:*"
}
}
"Resource" : "*"
}
]
})

depends_on = [module.bulk-upload-metadata-processor-lambda, module.sns_encryption_key]
}