It doesn't necessarily always matches the current infrastructure, since one can manually change resources and therefore drift from the state configuration. Terraform has no way to know or track changes made outside of it.
Incorrect,your next terraform plan or terraform refresh will inform you that there is change(provided the deployment was initially done via terraform).
tfstate reflects values from actual infrastructure deployed, and it picks drift from actual tf files.
No it doesn't.
This is because; terraform doesn't necessarily reconcile infrastructure automatically.
It is only after you run a terraform command like terraform plan does it reconcile your actual state with your desired state.
The correct answer is false because Terraform performs a refresh operation before any operation to update the state with the real infrastructure. This means the state file might not always perfectly match the current infrastructure if there are discrepancies between the state and the actual resources.
The terraform.tfstate file reflects Terraform's understanding of the infrastructure, but it may not always match the actual state of the infrastructure if changes have been made manually (outside of Terraform) or if the state file hasn't been updated after such changes. In those cases, the state file would be outdated or inaccurate.
B. False
The terraform.tfstate file reflects the infrastructure as it was last known to Terraform, but changes made outside of Terraform (manually or through other tools) may not be reflected in the state file until a terraform refresh or terraform plan is run to reconcile the differences.
The terraform.tfstate file maintains the state of your infrastructure as managed by Terraform. It keeps track of the resources that Terraform has provisioned and their current state.
Of course, it's B. For example, when you perform tasks in the AWS web console, you cannot see the .tfstate file. Additionally, if we add that, you can update it to the latest state through 'tf refresh.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
fabiomlop
Highly Voted 2 years, 10 months agogargaditya
2 years, 1 month agoNunyabiznes
2 years ago0kwame
Most Recent 2 weeks, 5 days agoeLJoudi
1 month, 3 weeks agoSoubi
3 months agodidistars13
3 months, 1 week agoSergiuss95
3 months, 2 weeks agoclouddevnoob
6 months agoerif
6 months, 2 weeks agoDeyemzy
6 months, 3 weeks agohrajkuma
9 months, 2 weeks agoHanu1
1 year, 2 months agosccampos
1 year, 3 months agoluxdolorosa
1 year, 5 months agomaze_
1 year, 7 months agohajurbau
1 year, 7 months agoJayanth
1 year, 9 months agoBusi57
1 year, 9 months ago