TA-002-P · Question #84
A terraform apply can not _________ infrastructure.
The correct answer is D. import. A terraform apply operation is used to provision, change, or destroy infrastructure according to the configuration. However, it cannot perform the import action, which is a separate command used to bring existing infrastructure under Terraform management.
Question
A terraform apply can not _________ infrastructure.
Options
- Achange
- Bdestroy
- Cprovision
- Dimport
How the community answered
(20 responses)- B5% (1)
- D95% (19)
Why each option
A `terraform apply` operation is used to provision, change, or destroy infrastructure according to the configuration. However, it cannot perform the `import` action, which is a separate command used to bring existing infrastructure under Terraform management.
`terraform apply` is precisely used to `change` existing infrastructure by modifying resource attributes.
`terraform apply -destroy` or an `apply` after removing resources from configuration can `destroy` infrastructure.
`terraform apply` is the primary command used to `provision` new infrastructure based on the configuration.
A `terraform apply` command executes the changes defined in a plan to bring infrastructure into alignment with the configuration; this includes provisioning new resources, changing existing ones, or destroying resources. However, importing existing infrastructure into the Terraform state is a distinct operation performed by the `terraform import` command, not `terraform apply`.
Concept tested: Terraform apply command capabilities
Source: https://developer.hashicorp.com/terraform/cli/commands/apply
Topics
Community Discussion
No community discussion yet for this question.