|
| 1 | +resource "aws_api_gateway_method" "get_document_references_fhir" { |
| 2 | + count = local.is_production ? 0 : 1 |
| 3 | + rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id |
| 4 | + resource_id = module.document-reference-gateway.gateway_resource_id |
| 5 | + http_method = "GET" |
| 6 | + authorization = "NONE" |
| 7 | + api_key_required = true |
| 8 | +} |
| 9 | + |
| 10 | + |
| 11 | +module "search-document-references-fhir-lambda" { |
| 12 | + count = local.is_production ? 0 : 1 |
| 13 | + source = "./modules/lambda" |
| 14 | + name = "SearchDocumentReferencesFHIRLambda" |
| 15 | + handler = "handlers.fhir_document_reference_search_handler.lambda_handler" |
| 16 | + iam_role_policy_documents = [ |
| 17 | + module.document_reference_dynamodb_table.dynamodb_read_policy_document, |
| 18 | + module.document_reference_dynamodb_table.dynamodb_write_policy_document, |
| 19 | + module.lloyd_george_reference_dynamodb_table.dynamodb_read_policy_document, |
| 20 | + module.lloyd_george_reference_dynamodb_table.dynamodb_write_policy_document, |
| 21 | + module.ndr-lloyd-george-store.s3_read_policy_document, |
| 22 | + module.ndr-document-store.s3_read_policy_document, |
| 23 | + module.ndr-app-config.app_config_policy |
| 24 | + ] |
| 25 | + rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id |
| 26 | + resource_id = aws_api_gateway_resource.get_document_references_fhir[0].id |
| 27 | + http_methods = ["GET"] |
| 28 | + api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn |
| 29 | + lambda_environment_variables = { |
| 30 | + APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id |
| 31 | + APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id |
| 32 | + APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id |
| 33 | + DYNAMODB_TABLE_LIST = "[\u0022${terraform.workspace}_${var.docstore_dynamodb_table_name}\u0022, \u0022${terraform.workspace}_${var.lloyd_george_dynamodb_table_name}\u0022]" |
| 34 | + WORKSPACE = terraform.workspace |
| 35 | + } |
| 36 | + depends_on = [ |
| 37 | + aws_api_gateway_rest_api.ndr_doc_store_api, |
| 38 | + module.search-document-references-gateway, |
| 39 | + module.ndr-app-config |
| 40 | + ] |
| 41 | +} |
0 commit comments