Recall & Review
beginner
What is the purpose of Terraform backend initialization?
Backend initialization configures where Terraform stores its state files, enabling collaboration and state locking to prevent conflicts.
Click to reveal answer
beginner
What command do you use to initialize a Terraform backend?
You use
terraform init to initialize the backend and prepare the working directory for Terraform operations.Click to reveal answer
intermediate
Why would you migrate a Terraform backend?
To move the Terraform state from one backend to another, for example, from local files to a remote storage for better collaboration and security.
Click to reveal answer
intermediate
What is the command to migrate Terraform state to a new backend?
Run
terraform init -migrate-state to migrate the existing state to the newly configured backend safely.Click to reveal answer
advanced
What happens if you change backend configuration without migrating state?
Terraform will not automatically move your state, which can cause errors or loss of state tracking. You must migrate state explicitly.
Click to reveal answer
Which command initializes the Terraform backend?
✗ Incorrect
terraform init sets up the backend and prepares Terraform for use.
What does the
-migrate-state flag do during terraform init?✗ Incorrect
It safely migrates the existing state to the newly configured backend.
Why is backend migration important?
✗ Incorrect
Migrating backend changes where Terraform stores state, enabling teamwork and security.
What happens if you change backend config but skip migration?
✗ Incorrect
Terraform will not find the existing state and may error or start fresh, risking resource mismanagement.
Which backend type is commonly used for remote state storage in Terraform?
✗ Incorrect
S3 buckets are popular for remote state storage due to durability and access control.
Explain the steps to migrate Terraform state from a local backend to a remote backend.
Think about changing config and using terraform init carefully.
You got /4 concepts.
Describe why backend initialization is critical before running Terraform commands.
Consider what happens if Terraform doesn't know where to save its progress.
You got /4 concepts.