3

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?

Ryan Fisch
  • 2,614
  • 5
  • 36
  • 57

1 Answers1

7

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.

RyanG
  • 3,973
  • 25
  • 19
  • was just in the process of setting up different accounts per environment, and then different subdomains for each environment to save the basepath for service domain names. Because of changes in services that are domain wide I was also considering minor versioning at the service endpoint level so multiple versions of the same endpoint coudl be access in teh same major version? I know we aren't supposed to discuss opinion statements here but api versioning is not a hard and fast science and specifically get weird when contending with API Gateway specific behaviors. – Ryan Fisch Aug 17 '16 at 21:43
  • I will also be looking into Cloudformation + Swagger to support build/deployment automation as well. – Ryan Fisch Aug 17 '16 at 21:43
  • could you possibly provide example formation template to handle api deployments? – Ryan Fisch Aug 17 '16 at 21:44