Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resource instance managed by newer provider version error

hi when i tried to run terraform plan in my azure ADF code, this error is popping out

please refer the attached image for more details

enter image description here

like image 632
Raghuram Reddy Vennam Avatar asked Feb 16 '26 05:02

Raghuram Reddy Vennam


1 Answers

The error from the screenshot is: Error: resource version managed by newer provider version

Error description:

The resource was created using a newer provider version than you have on your machine. You specify which providers to use like azurerm >= 2.7, so if you have 2.7 in your local environment terraform will not update the provider you have downloaded when you run the INIT, however, if the resource was created using azurerm 2.8 by someone else, a pipeline, etc, you will receive the error because they just downloaded the most recent provider, which you don't have.

Quick Fix:

Delete the file .terraform.lock.hcl and the folder .terraform from the folder you store your terraform files and run terraform init once again. Terraform will recreate the lock file and download the newest providers.

How to avoid it in the future:

Include the file .terraform.lock.hcl as part of the source code, this way everyone will use the same provider versions.

sources:

  • https://www.terraform.io/docs/language/dependency-lock.html
  • https://learn.hashicorp.com/tutorials/terraform/provider-versioning
like image 188
Gabriel Molter Avatar answered Feb 19 '26 20:02

Gabriel Molter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!