Staged migration

To replace an existing API with a serverless-based system, it makes sense to first implement the proxy pattern and define the complete API in API Gateway. Each endpoint would simply proxy requests and responses to and from their corresponding APIs on the system to be replaced.

It's even possible to start initial testing with what is called a proxy resource. With this model, one creates a resource in API Gateway named {proxy+}. This is a greedy resource and will match any URL path that doesn't already exist, be it /cats, /users/10/comments, and so on. It will also match on any HTTP verb. In short, it's a catch-all that will send any request that doesn't match an existing resource on to the configure Integration backend:

Get Serverless Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.