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

[BUG]Provider produced inconsistent final plan #183

Open
rishabhToshniwal opened this issue Apr 23, 2024 · 5 comments
Open

[BUG]Provider produced inconsistent final plan #183

rishabhToshniwal opened this issue Apr 23, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@rishabhToshniwal
Copy link

What is the bug?

Provider produced inconsistent final plan when the 'body' value for resource opensearch_component_template changes from plan to apply. In my case the body template would be dynamically fetched from private repo using null_resource. So during plan phase its considering the "{}" value while actually apply returns a JSON template resulting into this issue.

How can one reproduce the bug?

locals{
component_templates_map = {"my-template1": "http://localnexus:8080/mytemplatefile1"}
}
resource "null_resource" "download_component_templates"{
Downloading file from the local nexus and redirecting the response body into the file
}

resource "opensearch_component_template" "component_tempalte" {
provider = opensearch.opensearch_provider
for_each = local.component_templates_map
name = each.key
body = try(file("${path.module}/${each.key}_components.json"), "{}")
depends_on = [null_resource.download_component_templates]
}

Provider
opensearch = {
source = "opensearch-project/opensearch"
version = "2.2.1"
}

What is the expected behavior?

Open search component to be created.

What is your host/environment?

Linux

Do you have any screenshots?

image

Do you have any additional context?

Add any other context about the problem.

@rishabhToshniwal rishabhToshniwal added bug Something isn't working untriaged labels Apr 23, 2024
@rblcoder
Copy link
Collaborator

rblcoder commented May 6, 2024

The attribute needs the same value for plan phase and apply phase, hence the error.

@rblcoder rblcoder removed the untriaged label May 6, 2024
@rblcoder
Copy link
Collaborator

Further reference from hashicorp/terraform#25090 :
The general rule underlying that error is that if the plan for a particular attribute has a known value (anything other than "known after apply") during planning, the value must be exactly the same after the apply phase.

@estein9825
Copy link

I got the error by updating the access rights of the data policy with a new value. Planning showed it was going to update, and it did so at the apply. However it then spit out the error right after. So there is a bug with the read after the update.

@nidnogg
Copy link

nidnogg commented Sep 4, 2024

+1 on this, it is quite the struggle to get this piece working with AWS OpenSearch right now.

@estein9825
Copy link

If I then try rerunning it again, I get this error:

ValidationException: No changes detected in policy or policy description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📦 Backlog
Development

No branches or pull requests

4 participants