Use the ApiTagMap directive to use multiple API Gateway configurations in your application stack.
ApiTagMap:
HttpApiSecure:
- pet # The HttpApiSecure ApiGateway will call the Pet Lambda
ApiSecure:
- order # The ApiSecure ApiGateway will call the Order Lambda
See the Lambdas documentation for more details on how OpenApi tags map to ApiGateway endpoints and Lambda methods.
The following table shows how these mappings and routes associated with the tags generate lambda function methods:
API Configuration |
Route |
Lambda |
Method |
---|---|---|---|
ApiSecure |
GET /order/{orderId} |
Order |
GetOrderById(int64 orderId) |
HttpApiSecure |
GET /pet/{petId} |
Pet |
GetPetById(int64 petId) |
Here is another example where two lambdas are mapped to one ApiGateway:
ApiTagMap:
HttpApiSecure:
- pet # The HttpApiSecure ApiGateway will call the Pet Lambda
- order # the HttpApiSecure ApiGateway will call the Order Lambda
API Configuration |
Route |
Lambda |
Method |
---|---|---|---|
HttpApiSecure |
GET /order/{orderId} |
Order |
GetOrderById(int64 orderId) |
HttpApiSecure |
GET /pet/{petId} |
Pet |
GetPetById(int64 petId) |