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

Incorrect "Provider produced inconsistent final plan" error, changing CreateThenDelete to DeleteThenCreate. #26180

Closed
jbardin opened this issue Sep 9, 2020 · 1 comment · Fixed by #26192
Labels
bug confirmed a Terraform Core team member has reproduced this issue core explained a Terraform Core team member has described the root cause of this issue in code

Comments

@jbardin
Copy link
Member

jbardin commented Sep 9, 2020

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

@ghost
Copy link

ghost commented Oct 15, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug confirmed a Terraform Core team member has reproduced this issue core explained a Terraform Core team member has described the root cause of this issue in code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant