I do cdk deploy
and I get some of these outputs:
Outputs: feature.mycomRestApiEndpoint8FB5C89F = https://0lzzz8cdqc.execute-api.us-east-1.amazonaws.com/prod/ feature.mycomRestApiId9C720814 = 0lzzz8cdqc
I would like to automate to have this run, or have it happen within the CDK file:
aws apigateway get-export --parameters extension='integrations' --rest-api-id 0lzzz8cdqc --export-type swagger --accepts application/json --stage-name prod swagger_new.json
Ideally I would love to use https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_apigateway/CfnDocumentationPart.html
but I am using Typescript and not certain how to generate this.
I am using RestApi
.
This didn't work:
new apigateway.CfnDocumentationPart(this, 'siteDocs', {
restApiId: api.restApiId,
location: {
type: 'RESOURCE',
method: '*',
path: '/',
statusCode: '405'
},
properties: `
{
"status": "error",
"code": 405,
"message": "Method Not Allowed"
}
`
});
I got this error:
[Location type: RESOURCE must have a path and cannot have method, statusCode or
name defined.] (Service: AmazonApiGateway; Status Code: 400; Error Code: BadReq
uestException; Request ID: acfc9f58-534d-4851-a105-7783a4835388; Proxy: null)