HashiCorp Certified: Terraform Associate — Question 180

Which command adds existing resources into Terraform state?

Answer options

Correct answer: D

Explanation

The correct command to add existing resources to the Terraform state is 'terraform import'. The other options, such as 'terraform init', 'terraform plan', and 'terraform refresh', serve different purposes such as initializing a configuration, creating an execution plan, and updating the state file respectively, but do not import resources.