Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential service outage if no custom domain used in API Gateway #30

Open
szilveszter opened this issue Apr 9, 2018 · 1 comment
Open

Comments

@szilveszter
Copy link
Member

Just finished standing up a new service using the apigateway module, but ran into some strange behavior: after I changed something in the Swagger file, my API stopped working. After some investigation I found out that Terraform will delete the stage during the deployment process:

  1. Notices Swagger has changed, so the deployment resource has to be replaced
  2. Creates new deployment, pointing to the stage
  3. As the first step of getting rid of the old deployment resource, it deletes the stage

The reason why this does not happen to our existing services is thanks to mere luck: if there's an existing base path mapping pointing to the stage, the DeleteStage call fails, Terraform ignores that failure, and skips to the DeleteDeployment step.

Fortunately a patch is already available that fixes this behavior, hopefully it'll be merged upstream soon: hashicorp/terraform-provider-aws#3896

Until this gets fixed, the workaround is to set up a custom domain in the module, which is considered best practice anyway. I just wanted to raise awareness, and track the upstream issue.

@ryandub
Copy link
Contributor

ryandub commented Apr 9, 2018

Thanks for documenting this @szilveszter - that's a nasty bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants