TA-002-P · Question #51
Where in your Terraform configuration do you specify a state backend?
The correct answer is A. The terraform block. The state backend is configured inside the terraform block using a nested backend block. For example: terraform { backend "s3" { bucket = "my-bucket" } }. The terraform block is specifically reserved for Terraform's own settings, including required providers, required Terraform v
Question
Where in your Terraform configuration do you specify a state backend?
Options
- AThe terraform block
- BThe resource block
- CThe provider block
- DThe datasource block
How the community answered
(34 responses)- A88% (30)
- B3% (1)
- C3% (1)
- D6% (2)
Explanation
The state backend is configured inside the terraform block using a nested backend block. For example: terraform { backend "s3" { bucket = "my-bucket" } }. The terraform block is specifically reserved for Terraform's own settings, including required providers, required Terraform versions, and backend configuration. Resource blocks define infrastructure, provider blocks configure providers, and data source blocks read existing infrastructure - none of these are the correct location for backend configuration.
Topics
Community Discussion
No community discussion yet for this question.