-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Incorrect "Provider produced inconsistent final plan" error, changing CreateThenDelete to DeleteThenCreate. #26180
Copy link
Copy link
Closed
Labels
bugconfirmeda Terraform Core team member has reproduced this issuea Terraform Core team member has reproduced this issuecoreexplaineda Terraform Core team member has described the root cause of this issue in codea Terraform Core team member has described the root cause of this issue in code
Description
When a resource that is planned to be CreateThenDelete because of a forced created_before_destroy from another resource, but the create_before_destroy resource has no changes, the apply process is losing the CreateThenDelete portion of the plan.
For example:
resource "null_resource" "a" {
triggers = {
version = "1"
}
}
resource "null_resource" "b" {
depends_on = [null_resource.a]
lifecycle {
create_before_destroy = true
}
}
Applying this once, and changing resource a's version will cause null_resource.a to produce an invalid plan:
Error: Provider produced inconsistent final plan
When expanding the plan for null_resource.a to include new values learned so
far during apply, provider "registry.terraform.io/hashicorp/null" changed the
planned action from CreateThenDelete to DeleteThenCreate.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
This is erroneously attributed to the provider, but there is nothing the provider can do to modify the plan action for individual resources
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugconfirmeda Terraform Core team member has reproduced this issuea Terraform Core team member has reproduced this issuecoreexplaineda Terraform Core team member has described the root cause of this issue in codea Terraform Core team member has described the root cause of this issue in code