What command would you use to safely destroy all resources defined in your Terraform configuration?

  1. terraform delete
  2. terraform remove
  3. terraform destroy ✓
  4. terraform clean

Correct answer: terraform destroy

Option C, 'terraform destroy', is the correct command to safely destroy all resources defined in a Terraform configuration. It reads the current state file, constructs a destroy plan, shows a preview of what will be deleted, and requires confirmation before proceeding, making it the safe and intentional way to tear down infrastructure. Option A, 'terraform delete', is not a valid Terraform CLI command and will produce an error. Option B, 'terraform remove', does not exist as a top-level Terraform command; 'terraform state rm' removes resources from state without destroying them, which is a different operation. Option D, 'terraform clean', is also not a valid Terraform command and does not exist in the CLI.

Topic: · terraform, infrastructure-as-code, resource-lifecycle, cli-commands

Practice HashiCorp Terraform Associate (003) Questions Free