Rationale for Correct Answer: The Terraform import block (used with configuration-driven import) must specify:
id: the resource ID from the provider (the remote object identifier).
to: the target resource address in your configuration (where the imported object should map in state, e.g., aws_s3_bucket.example).These are the essential inputs Terraform needs to associate an existing remote object with a resource address in state.
Analysis of Incorrect Options (Distractors):
B (Provider): Not required as a parameter in the import block. Provider selection is determined by the configuration/provider setup (and optionally by provider meta-arguments on the resource), not by a required import block field.
D (Backend): Backends configure state storage and are set in the terraform block, unrelated to the import block’s required arguments.
Key Concept: Configuration-driven import requires mapping an existing remote object (id) to a resource address (to).
[Reference: Terraform Objectives — Read, Generate, and Modify Configurations (import blocks and configuration), and Navigate Terraform State and Backends (understanding what is and isn’t backend-related)., , , , ]
Submit