A provider release mishandles identity for one resource type
CommonThe newest provider added identity support, or changed it, for a resource type, and reads your existing resources of that type incorrectly. Every instance of that type fails the same way.
Confirm
terraform version git log -p --follow -- .terraform.lock.hcl | grep -E '^[-+] *version' | head
A provider upgrade just before the errors began, and all failing resources of one type
Fix
- Upgrade to the newest provider release with
terraform init -upgrade: these regressions are usually fixed within days. Read the provider's CHANGELOG for the resource type. - If the newest release still fails, pin the last version that worked, for example
version = ">= 6.0, != 6.59.0"or= 6.58.0, runterraform init -upgrade, and commit the lock file. - Search the provider's issues for the resource type and the message; if there is no report, open one with the error and both identities. The message is right that it is the provider's to fix.
terraform init -upgrade
Then plan. If it still fails, pin the last working version instead.