なんとなく使っている Terraform の State ファイルについて理解を深めてみたのでブログにまとめてみる。 State の目的 リアルワールドへのマッピング Terraform のステートファイルは、実際にデプロイされているインフラストラクチャと、そのマッピングに使われる。最初のTerraformのバージョンは、ステートファイルがなかったそうで、Tagで管理していたが、クラウドプロバイダによっては、そういうのがな無いため、すぐに問題になったとのこと。 terraform.tf provider "azurerm" { version = "=1.39.0" } terraform { backend "azurerm" { resource_group_name = "RemoveTerraform" storage_account_name = "tsushistatetf"