-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
While create a new api deployment aws_api_gateway_deployment tries to destroy existing deployment, which errors out as Active stages pointing to this deployment must be moved or deleted #10105
Comments
I am having this issue as well. Currently, the only solution that has worked for me is to See hashicorp/terraform#10674 for more details on this problem. |
enabling |
which resource needs this "create_before_destroy" lifecycle though? All of them? or just one of them? |
The deployment one |
Hi folks 👋 It looks like this was resolved above by adjusting the configuration, which would be our general recommendation in this case. This is not behavior we can turn on by default in the provider code for any resources. We very recently adjusted the documentation for the If there is still an issue after adding |
The problem @bflad is that it's not clear which resources need create_before_destroy, apart from just randomly applying it to objects and seeing what works. |
ok, I will try it next chance I get, please don't lock this ticket in the meantime, so I get a chance to reply |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @only1vinay as hashicorp/terraform#22792. It was migrated here as a result of the provider split. The original body of the issue is below.
In my api gateway deployment, I usually try to create a new deployment and attach it to a new versioned stage and an existing stage.
lets say I have versioned stages and a named stage 'latest' already provisioned.
Both latest and 1.0.1 are pointing to a latest deployment. In my new Terraform run, where swagger is updated to version 1.0.2 will update the aws_api_gateway_rest_api and triggers new aws_api_gateway_deployment with stage_name='latest' and also creates a new stage '1.0.2' with this new deployment.
Terraform apply errors out saying aws_api_gateway_deployment.deployment: BadRequestException: Active stages pointing to this deployment must be moved or deleted.
But I need my old deployment existing as it is getting used in 1.0.1 stage.
If everything runs good, the new stages will look like this
Terraform Version
Terraform Configuration Files
Expected Behavior
Successfully create the deployment to the stage specified. Leave the old deployment as it is, instead of trying to delete it.
Actual Behavior
aws_api_gateway_deployment.deployment: BadRequestException: Active stages pointing to this deployment must be moved or deleted
Steps to Reproduce
Additional Context
The api gets deployed properly with new stage. But terraform errors out aws_api_gateway_deployment tries to destroy existing deployment, which errors out as Active stages pointing to this deployment must be moved or deleted.
So workaround is, I go to console, select the stage (1.0.1) and change its deployment to older version.
References
The text was updated successfully, but these errors were encountered: