4 ms·
> Have Terraform plug into your Git history, take the Terraform code from the previous commit, and use that to calculate the old tree. So instead of generating
by Dunedan 3y ago
> Have Terraform plug into your Git history, take the Terraform code from the previous commit, and use that to calculate the old tree.
So instead of generating state by doing API requests, this would generate state from code in git, which does not necessarily represent the real world state of resources.
As much as I'd want Terraform without state I believe using Terraform code in git as state creates more problems than it solves. This approach isn't able to recognize changes made to resources done outside of Terraform. It also assumes the previous version of the Terraform code in git is always the one which got applied last, which isn't necessarily the case.
- ricardbejarano 3y ago> So instead of generating state by doing API requests, this would generate state from code in git, which does not necessarily represent the real world state of resources. What you're talking about here is unrelated to whether the state comes from regular Terraform state or if it's generated using the source code, as the refresh phase should happen during both.