问题
I am having trouble implementing a viable versioning scenario with API Gateway + Lambda. My requirement is to have major versioning at the API level but then minor versioning at the service level. My environments are also spread across accounts so staging is not an option for env propagation. Has anyone had success implementation API management with AWS API Gateway?
回答1:
In API Gateway, major versions should be represented by separate APIs. You can use the custom domain feature to map base paths to each API (i.e. myapi.com/v1 => API 1, myapi.com/v2 => API 2). You can also make use of the import/export functionality to manage changes between APIs.
Using separate accounts per environment is actually a suggested best-practice. I would suggest taking a good look at CloudFormation to manage your workflow - a single CloudFormation template would work well across multiple accounts.
来源:https://stackoverflow.com/questions/38987316/api-versioning-with-aws-api-gateway