terraform.tfstate
.hello state .tf
file and displays the state file.resource "local_file" "hello_state_file" { content = "Hello terraform state!" filename = "${path.module}/hello_state.txt" }
In the above code, we initialize a Terraform module using terraform init
, and then create a Terraform state file using terraform apply -auto-approve
.
We see that terraform.tfstate
file is created using ls
.
We can also see the content of terraform.tfstate
file using cat terraform.tfstate
.
Free Resources