Complete the code to initialize Terraform state in the current directory.
terraform [1]Terraform uses init to initialize the working directory and set up the state backend.
Complete the code to show the current Terraform state.
terraform [1]The terraform show command displays the current state or plan in a human-readable format.
Fix the error in the command to refresh Terraform state with real infrastructure.
terraform [1]The terraform refresh command updates the state file to match the real infrastructure.
Fill both blanks to list all resources in the Terraform state and filter by resource type.
terraform state [1] | grep [2]
terraform state list lists all resources in state. Using grep aws_instance filters to show only AWS instances.
Fill the blanks to remove a resource from Terraform state safely.
terraform state [1] [2]
terraform state rm aws_instance.example removes the resource from state without affecting real infrastructure.