Soru

Zorluk: KolayDeploying Infrastructure using Deployment Manager or Terraform

A cloud engineer has prepared a set of Terraform configuration files to provision Google Cloud infrastructure. Before applying any changes to the environment, the engineer wants to preview the execution plan and verify which resources will be created or modified. Which command should the cloud engineer run?

  1. terraform planCevap
  2. B
    terraform apply --preview
  3. C
    terraform init --dry-run
  4. D
    gcloud deployment-manager deployments preview

Cevap

The command 'terraform plan' should be run to preview resource changes before applying them.
Executing 'terraform plan' parses the local configuration files, compares them against the current Terraform state file and live GCP infrastructure, and outputs the detailed set of additions, modifications, or deletions that would occur upon deployment without altering any resources.

Adım Adım Çözüm

1
Identify the goal of the cloud engineer
The engineer needs to inspect planned infrastructure changes prior to deployment.
Previewing state changes prevents unintended modification or destruction of cloud infrastructure.
2
Match the requirement with standard Terraform CLI commands
The command 'terraform plan' reads the current state and configuration to output a detailed execution delta.
'terraform plan' is the designated Terraform command for speculative execution planning.

Anahtar Kavram

Terraform Execution Plan Generation
Tahmini Süre:45s
Bu soruyu puanla