Deployment, Provisioning, and Automation

An existing S3 bucket is absent from Terraform state, but its matching resource configuration has been added. A plan proposes creating the bucket, which must remain unchanged; how should the operator bring it under Terraform management?

Show the answer

Correct answerA. Import the bucket into its configured resource address.

AWhy this is right: Import binds the existing bucket to the configured resource address without creating a replacement.

BWhy not this: Targeting limits the operation's scope but does not associate the existing bucket with Terraform state.

CWhy not this: State removal stops tracking a resource and cannot adopt a bucket that is already absent from state.

DWhy not this: Refresh-only operations reconcile tracked objects; they do not import an untracked bucket.

Import associates an existing AWS resource with a Terraform resource address without recreating it. A refresh-only apply updates objects already tracked in state; it does not discover and adopt an unmanaged bucket.