State-Related Issues
As you already know, the Terraform state file (terraform.tfstate
) is a JSON document that maps your Terraform configurations to the resources that it is managing. This file tracks the metadata, resource relationships, and the actual state of resources.
The following sections talk about some of the state-related issues.
Configuration Drift
- There are times when you might have to make changes outside of Terraform. This could be because of a lack of knowledge of how to make these changes from Terraform or you may not have permission to modify the Terraform code. This could also be due to time constraints.
- While dealing with production issues where you are running against time, it is not uncommon to make the changes directly in the console. If you are managing too many resources in a single directory, Terraform can take a long time, and hence, a manual change may be warranted. Though this may not be the ideal way, this happens quite often in the real...