ASSOCIATE-CLOUD-ENGINEER practice question 6 of 35

You significantly changed a complex Deployment Manager template and want to confirm that the dependencies of all defined resources are properly met before committing it to the project. You want the most rapid feedback on your changes. What should you do?

Full set: 332 questions
Answer options
A: Use granular logging statements within a Deployment Manager template authored in Python.
B: Monitor activity of the Deployment Manager execution on the Stackdriver Logging page of the GCP Console.
C: Execute the Deployment Manager template against a separate project with the same configuration, and monitor for failures.
D: Execute the Deployment Manager template using the –-preview option in the same project, and observe the state of interdependent resources. Correct answer
Correct Answer:
D. Execute the Deployment Manager template using the –-preview option in the same project, and observe the state of interdependent resources.
Explanation

The most rapid and effective method to validate a Deployment Manager template without making actual changes to the project is by using the --preview flag. This feature allows you to see exactly which resources Deployment Manager will create, update, or delete. The preview process expands the full configuration, including resolving all dependencies, but does not instantiate any resources. If there are errors in the template, such as unmet dependencies or invalid resource properties, the preview operation will fail, providing immediate feedback. This directly addresses the need to confirm dependencies rapidly before committing.

Why Incorrect

A. Logging in Python templates is for debugging the template's code logic, not for a rapid, holistic validation of the final resource dependency graph before execution.
B. Monitoring logs in Cloud Logging requires an actual deployment attempt. This is a reactive approach and is not a pre-deployment check for rapid feedback.
C. Executing the template in a separate project is a valid integration testing strategy but is not the most rapid method for feedback, as it involves a full, potentially time-consuming deployment.

References

1. Google Cloud Documentation

"Previewing a configuration": "Before you commit to a configuration

you can preview it. Previewing a configuration expands the full configuration

including any templates

but does not instantiate any of the actual resources. Deployment Manager returns the expanded configuration so you can review the resources that Deployment Manager would create." This source confirms that --preview is the intended method for non-destructive validation.

Source: Google Cloud

Deployment Manager Documentation

"Previewing a configuration".

2. Google Cloud Documentation

gcloud deployment-manager deployments create: The documentation for the gcloud command explicitly describes the --preview flag: "If specified

the deployment is not created but a preview of the deployment is returned." This highlights its function as a non-executing check.

Source: Google Cloud SDK Documentation

gcloud deployment-manager deployments create.

Google Cloud

"Managing Deployments Using Google Cloud Deployment Manager": In the module on "Creating and Managing Deployments

" the courseware emphasizes using the preview feature as a best practice before applying changes. It states

"A preview shows you what resources will be created

but doesn't actually create them. This is a great way to test your configuration before you deploy it."

Google Cloud Training

"Essential Google Cloud Infrastructure: Core Services"

Week 4

"Managing Deployments Using Google Cloud Deployment Manager".

Scroll to Top