Terraform Versions Affected:
1.1.0 and 1.1.1
Some Terraform apply runs may not apply the expected planned changes and results in the State File being emptied unexpectedly.
Terraform CLI v1.1.0 and v1.1.1 both have a bug where a failure to construct the apply-time graph can cause Terraform to incorrectly report success and save an empty state, effectively "forgetting" all existing infrastructure. Although configurations that already worked on previous releases should not encounter this problem, it's possible that incorrect future configuration changes would trigger this behavior during the apply step instead of reporting an appropriate error.
This is due to a Bug described and resolved in GitHub Issue 30199 - Apply graph failure handling.
Please upgrade to v1.1.2 as soon as possible to receive the Bug fix; otherwise it will be necessary to restore the state file from backup and downgrade to v1.0.11.
- Visit the v1.1.2 Release Notes here for more information.
If needed, please raise a support ticket for additional help.