Google Professional Cloud Database Engineer Question 255
Single answerGoogle Cloud PlatformYour organization requires the automated provisioning of Cloud SQL instances for different environments (e.g., development, staging, production). The solution must ensure consistent configurations and minimize the need for manual intervention. Which approach should you use to achieve this?
- A
Use Deployment Manager to define and deploy Cloud SQL instances using a configuration file.
- B
Write a Python script using the Cloud SQL Admin API to create instances and manually execute the script when needed.
- C
Manually create a Cloud SQL instance template in the Google Cloud Console and reuse it for new instances.
- D
Use Terraform with a predefined module to automate the provisioning of Cloud SQL instances.
Show answer and explanation
Correct answer: D
Explanation
Terraform is a popular Infrastructure as Code tool that integrates well with Google Cloud. It allows you to define and manage resources, such as Cloud SQL instances, in a declarative manner. By using a predefined Terraform module, you can consistently provision instances with the same configurations across different environments, meeting the automation and consistency requirements of the scenario.
- A. Incorrect.
Deployment Manager can be used to automate resource provisioning, but it is less flexible and widely adopted compared to Terraform. It is not the most recommended solution for this scenario.
- B. Incorrect.
While the Cloud SQL Admin API allows you to programmatically create instances, manually executing the script does not fully automate the process and introduces additional operational overhead.
- C. Incorrect.
The Google Cloud Console does not support reusable templates for Cloud SQL instances. Manual creation does not align with the requirement for automation.
- D. Correct.
Terraform is widely used for Infrastructure as Code (IaC) and provides robust support for automating the provisioning of Google Cloud resources, including Cloud SQL instances. Using a predefined Terraform module ensures consistency and reduces manual intervention.