Open mparmar19 opened 3 years ago
Feel free to ask if you are looking for more details.
I am facing same issue.
"create_before_destroy = true" solution does not work
Same here. "create_before_destroy = true" isn't working.
Error: error deleting API Gateway Deployment (zxcbp2): BadRequestException: Active stages pointing to this deployment must be moved or deleted
same here
same
same
same
+1
Same here
same here
I have also encountered this, after switching from using a stage_name
in the aws_api_gateway_deployment
block directly to use an aws_api_gateway_stage
block. This is a significant problem and really needs to be addressed, as it's a major degradation of functionality.
for what's it worth:
lifecycle {
create_before_destroy = true
}
on aws_api_gateway_deployment
resource worked for me.
% terraform --version
Terraform v1.5.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.55.0
example of output:
aws_api_gateway_deployment.this["a"]: Creating...
aws_api_gateway_deployment.this["b"]: Creating...
aws_api_gateway_deployment.this["c"]: Creating...
aws_api_gateway_deployment.this["c"]: Creation complete after 0s [id=SANITIZED]
aws_api_gateway_deployment.this["a"]: Creation complete after 0s [id=SANITIZED]
aws_api_gateway_deployment.this["b"]: Creation complete after 2s [id=SANITIZED]
aws_api_gateway_stage.this["b"]: Modifying... [id=SANITIZED]
aws_api_gateway_stage.this["c"]: Modifying... [id=SANITIZED]
aws_api_gateway_stage.this["a"]: Modifying... [id=SANITIZED]
aws_api_gateway_stage.this["b"]: Modifications complete after 1s [id=SANITIZED]
aws_api_gateway_stage.this["c"]: Modifications complete after 1s [id=SANITIZED]
aws_api_gateway_stage.this["a"]: Modifications complete after 1s [id=SANITIZED]
aws_api_gateway_deployment.this["a"] (deposed object 6048297a): Destroying... [id=SANITIZED]
aws_api_gateway_deployment.this["c"] (deposed object 24f3073a): Destroying... [id=SANITIZED]
aws_api_gateway_deployment.this["b"] (deposed object 95a2357a): Destroying... [id=SANITIZED]
aws_api_gateway_deployment.this["a"]: Destruction complete after 0s
aws_api_gateway_deployment.this["b"]: Destruction complete after 0s
aws_api_gateway_deployment.this["c"]: Destruction complete after 0s
meaning: created the new deployment - pointed the stage to new deployment, deleted the deployment.
maybe i was lucky or api-gateway service became faster at switching stages between deployments...
Does anyone cares to close issues in this repo? If terraform providers have such long due issues, people should start considering other tools maybe. Everything has issues, it's just how affectful they are.
Community Note
I have tried couple of solution but I am seeing the same general error. People have provided multiple solutions using create_before_destroy = true, use trigger etc but none of the solutions work if
aws_api_gateway_base_path_mapping
is used in same .tf file.The only solution works is to using
taint
or comment theaws_api_gateway_base_path_mapping
block and uncomment again and run theterraform apply
twice.In our use case we already have stage deployed using
aws_api_gateway_deployment
and now we want to enable API logs exported to CloudWatch. The only way is to useaws_api_gateway_stage
andaws_api_gateway_method_settings
so we are modifying stage as well.I have tried https://github.com/hashicorp/terraform/issues/10674 , https://stackoverflow.com/questions/42760387/terraform-aws-api-gateway-dependency-conundrum/42783769#42783769 , https://github.com/hashicorp/terraform-provider-aws/issues/2918 and couple more I can't even remember.
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
terraform apply
Important Factoids
References
0000