Rationale for Correct Answer: Remote state storage is configured using a backend block, which lives inside the top-level terraform block (for example, terraform { backend " s3 " { ... } }). Backends control where Terraform stores state (local vs remote), locking, and related settings—this is squarely in the Terraform configuration’s global settings area, not in resources or providers.
Analysis of Incorrect Options (Distractors):
A (The resource block): Resources define infrastructure objects (e.g., servers, buckets). They do not configure where Terraform stores state.
B (The provider block): Providers configure how Terraform talks to an API (credentials/regions/features). They don’t define state storage.
C (The data block): Data sources read existing infrastructure; they are unrelated to backend/state storage configuration.
Key Concept: Backends and remote state configuration using terraform { backend ... }.
[Reference: Terraform Objectives — Navigate Terraform State and Backends (backends/remote state), Implement and Maintain State (state storage and locking)., , , , ]
Submit