diff --git a/cumulus_lambda_functions/uds_api/web_service.py b/cumulus_lambda_functions/uds_api/web_service.py index 98c5cb83..ae77d68d 100644 --- a/cumulus_lambda_functions/uds_api/web_service.py +++ b/cumulus_lambda_functions/uds_api/web_service.py @@ -21,7 +21,7 @@ description='API to interact with UDS services', docs_url=f'/{api_base_prefix}/docs', redoc_url=f'/{api_base_prefix}/redoc', - openapi_url=f'/{api_base_prefix}/docs/openapi', + openapi_url=f'/{api_base_prefix}/openapi', ) app.add_middleware( CORSMiddleware, diff --git a/tf-module/unity-cumulus/api_gateway.tf b/tf-module/unity-cumulus/api_gateway.tf index 5a255079..f3fd2473 100644 --- a/tf-module/unity-cumulus/api_gateway.tf +++ b/tf-module/unity-cumulus/api_gateway.tf @@ -50,6 +50,7 @@ resource "aws_api_gateway_deployment" "shared_services_api_gateway_deployment" { depends_on = [ aws_api_gateway_integration.openapi_lambda_integration, + aws_api_gateway_integration.docs_lambda_integration, aws_api_gateway_integration.misc_catalog_list_lambda_integration, aws_api_gateway_integration.misc_stac_entry_lambda_integration, diff --git a/tf-module/unity-cumulus/api_gateway_04_docs.tf b/tf-module/unity-cumulus/api_gateway_04_docs.tf new file mode 100644 index 00000000..cdc412a5 --- /dev/null +++ b/tf-module/unity-cumulus/api_gateway_04_docs.tf @@ -0,0 +1,33 @@ +resource "aws_api_gateway_resource" "docs_resource" { + rest_api_id = data.aws_api_gateway_rest_api.rest_api.id + parent_id = aws_api_gateway_resource.uds_api_base_resource.id + path_part = "docs" +} + +resource "aws_api_gateway_method" "docs_method" { + rest_api_id = data.aws_api_gateway_rest_api.rest_api.id + resource_id = aws_api_gateway_resource.docs_resource.id + http_method = "GET" + authorization = "NONE" + request_parameters = { + "method.request.path.proxy" = true + } +} + +resource "aws_api_gateway_integration" "docs_lambda_integration" { + rest_api_id = data.aws_api_gateway_rest_api.rest_api.id + resource_id = aws_api_gateway_resource.docs_resource.id + http_method = aws_api_gateway_method.docs_method.http_method + type = "AWS_PROXY" + uri = aws_lambda_function.uds_api_1.invoke_arn + integration_http_method = "POST" + +# cache_key_parameters = ["method.request.path.proxy"] + + timeout_milliseconds = 29000 +# request_parameters = { +# "integration.request.path.proxy" = "method.request.path.proxy" +# } +} + +########################################################################################################################## \ No newline at end of file