API - API Docs eway module
This module creates the API Docs resources on a provided AWS API Gateway.
Example
Typical Usage::
from stacks.resources.api_gateway.resources import api_docs
api_docs.create(stack, created_api_gateway, auth, api_doc_function_arn)
create(stack, rest_api_gateway, auth, api_doc_function_arn, model_name='docs')
Create the API resource and methods on the provided REST API Gateway.
Creates a GET method on the /{model_name}
resource with a forward to /{model_name}/index.html
and a ANY method with a Lambda Proxy Integration to serve the API Documentation via this Lambda function.
Attributes:
Name | Type | Description |
---|---|---|
stack |
aws_cdk.core.Stack
|
CDK Stack. |
rest_api_gateway |
aws_cdk.aws_apigateway.RestApi
|
Rest API to add to. |
auth |
aws_cdk.aws_cognito.CognitoUserPoolsAuthorizer
|
Cognito User Pool Authorizer used for the endpoint authentication. |
api_doc_function_arn |
str
|
ARN of the Lambda function which is called by the method |
model_name |
Optional[str]
|
The path for the resources, default |
Source code in infrastructure/stacks/resources/api_gateway/resources/api_docs.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|