Soru

Zorluk: OrtaDeploying Infrastructure using Deployment Manager or Terraform

A Cloud Engineer needs to update an existing Google Cloud Deployment Manager deployment named `prod-network` using a revised template configuration file `vpc-config.yaml`. The engineer must first preview the resource modifications without finalizing the deployment, and then apply the previewed changes to update the live environment. Which TWO `gcloud` CLI commands should the engineer execute to complete this workflow?

  1. Run `gcloud deployment-manager deployments update prod-network --config vpc-config.yaml --preview` to stage and view the proposed resource changes.Cevap
  2. Run `gcloud deployment-manager deployments update prod-network` without specifying the `--config` flag to commit the previewed deployment changes.Cevap
  3. C
    Run `gcloud deployment-manager deployments plan prod-network --config vpc-config.yaml` to save an execution plan file locally.
  4. D
    Run `gcloud services enable deploymentmanager.googleapis.com` in the target project to automatically apply previewed configurations.

Cevap

The two required commands are running `gcloud deployment-manager deployments update prod-network --config vpc-config.yaml --preview` to stage the changes, followed by `gcloud deployment-manager deployments update prod-network` to apply the previewed configuration.
To safely preview changes in Google Cloud Deployment Manager, you execute `gcloud deployment-manager deployments update [DEPLOYMENT_NAME] --config [CONFIG_FILE] --preview`. Once verified, executing `gcloud deployment-manager deployments update [DEPLOYMENT_NAME]` without referencing the configuration file applies the staged preview to active resources.

Adım Adım Çözüm

1
Stage and preview changes in Deployment Manager
Deployment Manager creates a preview state showing planned resource changes without modifying active infrastructure.
Passing `--preview` with `gcloud deployment-manager deployments update` evaluates the new template configuration against current resources safely.
2
Review the preview output
The engineer verifies intended additions, modifications, and deletions.
Validating the preview ensures no unintended resource disruptions occur during update execution.
3
Commit the previewed update
Deployment Manager applies the previewed state to the target project.
Executing `gcloud deployment-manager deployments update prod-network` without the `--config` flag instructs Deployment Manager to commit the pending preview.

Anahtar Kavram

Deployment Manager Preview and Update Lifecycle Workflow
Tahmini Süre:1m 30s
Bu soruyu puanla