Google Associate Cloud EngineerDeploying and implementing a cloud solutionMedium
A company is deploying a complex multi-tier application using Cloud Deployment Manager. They have defined the infrastructure for their web servers, database, and load balancers in separate configuration files. How can they ensure these resources are deployed in a specific order, such as the database before the web servers?
- ADefine explicit dependencies using the 'dependsOn' keyword in the configuration.
- BCloud Deployment Manager automatically detects dependencies and deploys in the correct order.
- CDeploy each configuration file manually in the desired order.
- DUse a Cloud Functions script to orchestrate the deployment order.
Show answer & explanationAnswer & explanation
Correct answer: A. Define explicit dependencies using the 'dependsOn' keyword in the configuration.
Cloud Deployment Manager allows you to define explicit dependencies between resources using the 'dependsOn' keyword. This ensures that a resource is created only after its dependencies are fully deployed, guaranteeing the correct deployment order.
Why the other options are wrong
- B. Deployment Manager does not automatically detect all implicit dependencies, especially across different types of resources or if not explicitly defined.
- C. Manual deployment defeats the purpose of Infrastructure as Code and is error-prone for complex deployments.
- D. While possible, using Cloud Functions for orchestration is an overly complex solution when Deployment Manager provides native dependency management.
Cloud Deployment Manager Dependencies
A feature in Cloud Deployment Manager that allows you to specify the order in which resources are created, updated, or deleted by defining explicit relationships between them.
- Uses the 'dependsOn' keyword in configuration files.
- Ensures that a resource is deployed only after its prerequisites are met.
- Crucial for complex multi-tier applications where order matters.
Memory trick: Deployment Manager 'depends' on explicit instructions.