Skip to content

Commit

Permalink
feat: trying to get docs page working (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
wphyojpl authored Sep 9, 2024
1 parent 9436c27 commit cc4c1bf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cumulus_lambda_functions/uds_api/web_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tf-module/unity-cumulus/api_gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
33 changes: 33 additions & 0 deletions tf-module/unity-cumulus/api_gateway_04_docs.tf
Original file line number Diff line number Diff line change
@@ -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"
# }
}

##########################################################################################################################

0 comments on commit cc4c1bf

Please sign in to comment.