I've read a lots of API versioning hints for integrating AWS API Gateway with Lambda functions. But most of them used the URL to provide the version number e.g. /v1/orders
But I do not want to use this pattern. Instead I'd like to evaluate the header information to retrieve the requested version.
What I want to do is the following:
- configure API Gateway (via CloudFormation) in order to define only
/orders - use request mapping to read a header 'version'
- call a lambda function e.g.
getOrders:v1if 'version' header is set to 'v1'
Is this possible with AWS Api Gateway? Or is there a similar approach that doesn't use URL to distinguish between versions?
I saw a solution by using stage variables: https://dzone.com/articles/api-versioning-approach-with-aws-api-gateway
Regarding this approach: Is there an equivalent to ${stageVariables.v1fn} for headers? E.g. ${request.headers.version}?