I am currently trying to use aws api gateway CLI to create a multi-level base path mapping. I am running the following command:
aws apigateway create-base-path-mapping \
--domain-name example.com --base-path orders/v2 \
--rest-api-id abcd --stage production
which gives me an error:
An error occurred (
BadRequestException) when calling the CreateBasePathMapping operation: API Gateway V1 doesn't support the slash character (/) in base path mappings. To create a multi-level base path mapping, use API Gateway V2.
This is inconsistent with https://aws.amazon.com/blogs/compute/using-multiple-segments-in-amazon-api-gateway-base-path-mapping/ which states for REST Api's use API Gateway V1. When trying to use API Gateway V2 we get an error stating it can only be used for HTTP API's.
How does one create a multi-level base path mapping for REST APIs?