TA-002-P · Question #419
Changing the Terraform backend from the default "local" backend to a different one after doing your first terraform apply is:
The correct answer is B. Optional. Migrating from the local backend to a remote backend after an initial apply is optional - Terraform supports backend changes at any time by migrating existing state.
Question
Changing the Terraform backend from the default "local" backend to a different one after doing your first terraform apply is:
Options
- AMandatory
- BOptional
- CImpossible
- DDiscouraged
How the community answered
(36 responses)- A3% (1)
- B94% (34)
- C3% (1)
Why each option
Migrating from the local backend to a remote backend after an initial apply is optional - Terraform supports backend changes at any time by migrating existing state.
Mandatory is incorrect; many valid workflows use the local backend throughout a project's lifetime, particularly for personal or single-user projects.
Terraform allows you to change the backend configuration after infrastructure has already been provisioned. Running terraform init after updating the backend block prompts Terraform to migrate the existing state to the new backend, making the switch optional and reversible rather than mandatory, impossible, or discouraged.
Impossible is incorrect; terraform init handles state migration when the backend block is changed, making the transition straightforward.
Discouraged is incorrect; migrating to a remote backend is actually encouraged as a best practice for collaboration, not something to avoid.
Concept tested: Changing Terraform backend after initial apply
Source: https://developer.hashicorp.com/terraform/language/settings/backends/configuration#changing-backend-configuration
Topics
Community Discussion
No community discussion yet for this question.