An enterprise platform team is developing modular Google Cloud Deployment Manager templates written in Python to dynamically calculate persistent disk allocations and VM custom metadata based on environment variables. A cloud engineer must first inspect the fully expanded resource manifests and dry-run state without actually provisioning infrastructure in Google Cloud. Once the generated configuration is audited and approved, the engineer must commit and provision the resources. Which TWO steps should the cloud engineer take to execute this deployment lifecycle?
- Execute `gcloud deployment-manager deployments create prod-stack --config=config.yaml --preview` to stage and inspect the expanded resource manifest.Cevap
- Execute `gcloud deployment-manager deployments update prod-stack` after reviewing the preview state to instantiate the planned resources.Cevap
- CEnable the Deployment Manager API exclusively in the organization's Shared VPC host project and run `gcloud deployment-manager deployments create prod-stack --config=config.yaml --dry-run`.
- DExecute `gcloud deployment-manager deployments preview prod-stack --config=config.yaml` followed by `gcloud deployment-manager deployments commit prod-stack` to finalize provisioning.
Cevap
The cloud engineer should first execute the deployment create command with the `--preview` flag to generate and inspect the template expansion, and then execute the deployment update command on the existing preview deployment to commit and provision the infrastructure.
In Google Cloud Deployment Manager, dry-running template expansion requires using the `--preview` flag in conjunction with the `deployments create` or `deployments update` command. This compiles the Python/Jinja templates into a expanded manifest and saves the deployment in a PREVIEW state. Once the manifest is audited, running `gcloud deployment-manager deployments update [DEPLOYMENT_NAME]` without specifying a new config file commits the previewed deployment and provisions the resources.
Adım Adım Çözüm
Anahtar Kavram
Deployment Manager Preview and Update Lifecycle