From 0dbd36bfb14e83637f6d417b39d2a85a10ca73a3 Mon Sep 17 00:00:00 2001 From: abbas-khan10 <127417949+abbas-khan10@users.noreply.github.com> Date: Tue, 17 Sep 2024 16:25:30 +0100 Subject: [PATCH] PRMP-914: Revert prod changes to disable individual user upload (#190) --- infrastructure/lambda-create-doc-ref.tf | 10 ++++------ infrastructure/lambda-update-upload-state.tf | 10 ++++------ infrastructure/lambda-upload-confirm-result.tf | 10 ++++------ infrastructure/lambda-virus-scan-result.tf | 10 ++++------ 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/infrastructure/lambda-create-doc-ref.tf b/infrastructure/lambda-create-doc-ref.tf index 3a13305b..31093fd2 100644 --- a/infrastructure/lambda-create-doc-ref.tf +++ b/infrastructure/lambda-create-doc-ref.tf @@ -77,12 +77,10 @@ module "create-doc-ref-lambda" { aws_iam_policy.ssm_access_policy.arn, module.ndr-app-config.app_config_policy_arn, ] - rest_api_id = local.is_production ? null : aws_api_gateway_rest_api.ndr_doc_store_api.id - resource_id = local.is_production ? null : module.create-doc-ref-gateway.gateway_resource_id - api_execution_arn = local.is_production ? null : aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn - is_gateway_integration_needed = local.is_production ? false : true - is_invoked_from_gateway = local.is_production ? false : true - http_methods = ["POST"] + rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id + resource_id = module.create-doc-ref-gateway.gateway_resource_id + http_methods = ["POST"] + api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn lambda_environment_variables = { STAGING_STORE_BUCKET_NAME = "${terraform.workspace}-${var.staging_store_bucket_name}" APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id diff --git a/infrastructure/lambda-update-upload-state.tf b/infrastructure/lambda-update-upload-state.tf index aeacc4f0..96e98b5d 100644 --- a/infrastructure/lambda-update-upload-state.tf +++ b/infrastructure/lambda-update-upload-state.tf @@ -73,12 +73,10 @@ module "update-upload-state-lambda" { "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy", module.ndr-app-config.app_config_policy_arn, ] - rest_api_id = local.is_production ? null : aws_api_gateway_rest_api.ndr_doc_store_api.id - resource_id = local.is_production ? null : module.update-upload-state-gateway.gateway_resource_id - api_execution_arn = local.is_production ? null : aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn - is_gateway_integration_needed = local.is_production ? false : true - is_invoked_from_gateway = local.is_production ? false : true - http_methods = ["POST"] + rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id + resource_id = module.update-upload-state-gateway.gateway_resource_id + http_methods = ["POST"] + api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn lambda_environment_variables = { APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id diff --git a/infrastructure/lambda-upload-confirm-result.tf b/infrastructure/lambda-upload-confirm-result.tf index 014945a4..e8ff1b2d 100644 --- a/infrastructure/lambda-upload-confirm-result.tf +++ b/infrastructure/lambda-upload-confirm-result.tf @@ -75,12 +75,10 @@ module "upload_confirm_result_lambda" { module.document_reference_dynamodb_table.dynamodb_policy, module.lloyd_george_reference_dynamodb_table.dynamodb_policy, ] - rest_api_id = local.is_production ? null : aws_api_gateway_rest_api.ndr_doc_store_api.id - resource_id = local.is_production ? null : module.upload_confirm_result_gateway.gateway_resource_id - api_execution_arn = local.is_production ? null : aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn - is_gateway_integration_needed = local.is_production ? false : true - is_invoked_from_gateway = local.is_production ? false : true - http_methods = ["POST"] + rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id + resource_id = module.upload_confirm_result_gateway.gateway_resource_id + http_methods = ["POST"] + api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn lambda_environment_variables = { APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id diff --git a/infrastructure/lambda-virus-scan-result.tf b/infrastructure/lambda-virus-scan-result.tf index 9e062482..14f51ae4 100644 --- a/infrastructure/lambda-virus-scan-result.tf +++ b/infrastructure/lambda-virus-scan-result.tf @@ -76,12 +76,10 @@ module "virus_scan_result_lambda" { module.document_reference_dynamodb_table.dynamodb_policy, module.lloyd_george_reference_dynamodb_table.dynamodb_policy, ] - rest_api_id = local.is_production ? null : aws_api_gateway_rest_api.ndr_doc_store_api.id - resource_id = local.is_production ? null : module.virus_scan_result_gateway.gateway_resource_id - api_execution_arn = local.is_production ? null : aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn - is_gateway_integration_needed = local.is_production ? false : true - is_invoked_from_gateway = local.is_production ? false : true - http_methods = ["POST"] + rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id + resource_id = module.virus_scan_result_gateway.gateway_resource_id + http_methods = ["POST"] + api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn lambda_environment_variables = { APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id