From 47b014c3ca8a325d06bc1a97b3b734a0bb29064c Mon Sep 17 00:00:00 2001 From: PedroSoaresNHS Date: Wed, 17 Dec 2025 13:44:13 +0000 Subject: [PATCH 1/6] [PRMP-1054] create report orchestration lambda --- infrastructure/lambda-report-orchestration.tf | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 infrastructure/lambda-report-orchestration.tf diff --git a/infrastructure/lambda-report-orchestration.tf b/infrastructure/lambda-report-orchestration.tf new file mode 100644 index 000000000..096b32778 --- /dev/null +++ b/infrastructure/lambda-report-orchestration.tf @@ -0,0 +1,27 @@ +module "report-orchestration-lambda" { + source = "./modules/lambda" + name = "reportOrchestration" + handler = "handlers.report_orchestration_handler.lambda_handler" + lambda_timeout = 900 + memory_size = 1769 + + iam_role_policy_documents = [ + module.bulk_upload_report_dynamodb_table.dynamodb_read_policy_document, + module.bulk_upload_report_dynamodb_table.dynamodb_write_policy_document, + data.aws_iam_policy.aws_lambda_vpc_access_execution_role.policy, + ] + + 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 + + BULK_UPLOAD_REPORT_TABLE_NAME = "${terraform.workspace}_BulkUploadReport" + } + + rest_api_id = null + api_execution_arn = null + is_gateway_integration_needed = false + is_invoked_from_gateway = false +} From a2741a9c11f654c830e39468dc12dc0f45ceba7c Mon Sep 17 00:00:00 2001 From: PedroSoaresNHS Date: Wed, 17 Dec 2025 13:44:24 +0000 Subject: [PATCH 2/6] [PRMP-1054] create report orchestration lambda --- infrastructure/lambda-report-orchestration.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/infrastructure/lambda-report-orchestration.tf b/infrastructure/lambda-report-orchestration.tf index 096b32778..d8ba76fa6 100644 --- a/infrastructure/lambda-report-orchestration.tf +++ b/infrastructure/lambda-report-orchestration.tf @@ -12,10 +12,10 @@ module "report-orchestration-lambda" { ] 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 + 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 BULK_UPLOAD_REPORT_TABLE_NAME = "${terraform.workspace}_BulkUploadReport" } From 3f19e7ca7f59d1ae4dc03f49b472152f7469abe0 Mon Sep 17 00:00:00 2001 From: PedroSoaresNHS Date: Thu, 18 Dec 2025 14:18:41 +0000 Subject: [PATCH 3/6] [PRMP-1054] trying to fix terraform --- infrastructure/lambda-report-orchestration.tf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/infrastructure/lambda-report-orchestration.tf b/infrastructure/lambda-report-orchestration.tf index d8ba76fa6..a99592e8c 100644 --- a/infrastructure/lambda-report-orchestration.tf +++ b/infrastructure/lambda-report-orchestration.tf @@ -1,7 +1,7 @@ module "report-orchestration-lambda" { - source = "./modules/lambda" - name = "reportOrchestration" - handler = "handlers.report_orchestration_handler.lambda_handler" + source = "./modules/lambda" + name = "reportOrchestration" + handler = "handlers.report_orchestration_handler.lambda_handler" lambda_timeout = 900 memory_size = 1769 @@ -16,7 +16,6 @@ module "report-orchestration-lambda" { APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id WORKSPACE = terraform.workspace - BULK_UPLOAD_REPORT_TABLE_NAME = "${terraform.workspace}_BulkUploadReport" } @@ -24,4 +23,12 @@ module "report-orchestration-lambda" { api_execution_arn = null is_gateway_integration_needed = false is_invoked_from_gateway = false + + depends_on = [ + module.bulk_upload_report_dynamodb_table + ] +} + +data "aws_iam_policy" "aws_lambda_vpc_access_execution_role" { + arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole" } From 03bccf486d7e073082cb2b43c7d1e9331e85930b Mon Sep 17 00:00:00 2001 From: PedroSoaresNHS Date: Thu, 18 Dec 2025 14:19:00 +0000 Subject: [PATCH 4/6] [PRMP-1054] trying to fix terraform --- infrastructure/lambda-report-orchestration.tf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/infrastructure/lambda-report-orchestration.tf b/infrastructure/lambda-report-orchestration.tf index a99592e8c..81a58e288 100644 --- a/infrastructure/lambda-report-orchestration.tf +++ b/infrastructure/lambda-report-orchestration.tf @@ -1,7 +1,7 @@ module "report-orchestration-lambda" { - source = "./modules/lambda" - name = "reportOrchestration" - handler = "handlers.report_orchestration_handler.lambda_handler" + source = "./modules/lambda" + name = "reportOrchestration" + handler = "handlers.report_orchestration_handler.lambda_handler" lambda_timeout = 900 memory_size = 1769 @@ -12,10 +12,10 @@ module "report-orchestration-lambda" { ] 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 + 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 BULK_UPLOAD_REPORT_TABLE_NAME = "${terraform.workspace}_BulkUploadReport" } From 1e4471bf1e2a244d3e97f6490454c86cf80c8c1c Mon Sep 17 00:00:00 2001 From: PedroSoaresNHS Date: Fri, 19 Dec 2025 08:47:38 +0000 Subject: [PATCH 5/6] [PRMP-1054] trying to fix terraform --- infrastructure/lambda-report-orchestration.tf | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/infrastructure/lambda-report-orchestration.tf b/infrastructure/lambda-report-orchestration.tf index 81a58e288..c4a4a4b60 100644 --- a/infrastructure/lambda-report-orchestration.tf +++ b/infrastructure/lambda-report-orchestration.tf @@ -27,8 +27,4 @@ module "report-orchestration-lambda" { depends_on = [ module.bulk_upload_report_dynamodb_table ] -} - -data "aws_iam_policy" "aws_lambda_vpc_access_execution_role" { - arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole" -} +} \ No newline at end of file From cd1b3f5aeeb3cf18e45cf994f024cf89f8bd10d8 Mon Sep 17 00:00:00 2001 From: PedroSoaresNHS Date: Fri, 19 Dec 2025 16:24:34 +0000 Subject: [PATCH 6/6] [PRMP-1054] removed null declarations --- infrastructure/lambda-report-orchestration.tf | 2 -- 1 file changed, 2 deletions(-) diff --git a/infrastructure/lambda-report-orchestration.tf b/infrastructure/lambda-report-orchestration.tf index c4a4a4b60..41bb242d6 100644 --- a/infrastructure/lambda-report-orchestration.tf +++ b/infrastructure/lambda-report-orchestration.tf @@ -19,8 +19,6 @@ module "report-orchestration-lambda" { BULK_UPLOAD_REPORT_TABLE_NAME = "${terraform.workspace}_BulkUploadReport" } - rest_api_id = null - api_execution_arn = null is_gateway_integration_needed = false is_invoked_from_gateway = false