-
Notifications
You must be signed in to change notification settings - Fork 8
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
Terraform plan and apply fails when resource exists in state, but not in Coralogix backend #317
Comments
Hi - thanks for bringing this up, we'll take a look |
This behaviour is also impacting the "terraform destroy" action. When a resource is not found by the API, the delete action errors instead of removing it from state. Affected Resource(s)coralogix_dashboards_folder, coralogix_dashboard, coralogix_alert Terraform Configuration Files
Terraform Versionv1.9.8 Provider Versionv2.0.5 Debug Output
Expected BehaviorOn a delete action, the provider should ignore “resource not found” errors since the operation was intended. It should then remove the resource from the statefile. Actual BehaviorTerraform destroy fails during the implicit plan due the resource not found. Steps to Reproduce
|
When a dashboard folder resource managed by Terraform is deleted from Coralogix using the Coralogix UI, the Terraform plan / apply can no longer be run without erroring.
Affected Resource(s)
coralogix_dashboards_folder
Terraform Configuration Files
resource "coralogix_dashboards_folder" "platform" {
name = "Platform"
}
Terraform Version
v1.9.8
Provider Version
v2.0.4
Note: I'm aware that v2.0.6 is newest version as of raising this issue, however, we are pinned to 2.0.4 due to other issues, and nothing in the changelog indicates using v2.0.6 will resolve this issue
Debug Output
Planning failed. Terraform encountered an error while generating this plan.
│ Error: Dashboard folder "b79bce15-7b5c-4a39-92bd-c2edbebad100" is in state, but no longer exists in Coralogix backend
│ with coralogix_dashboards_folder.platform,
│ on ./dashboard_folders.tf line 24, in resource "coralogix_dashboards_folder" "platform":
│ 24: resource "coralogix_dashboards_folder" "platform" {
│
│ b79bce15-7b5c-4a39-92bd-c2edbebad100 will be recreated when you apply
Expected Behavior
On a read with no backend resource found, the provider should remove the resource from the state, not fail the build.
https://discuss.hashicorp.com/t/how-should-read-signal-that-a-resource-has-vanished-from-the-api-server/40833
This is an issue, as Terraform apply runs an implicit plan before any actions are taken, and this error makes it so it is not possible to run an apply and fix the state issue.
Actual Behavior
Instead of handling the error, the plan/apply is failed
Steps to Reproduce
Community Note
The text was updated successfully, but these errors were encountered: