Google Professional Cloud DevOps Engineer Question 65
Select 3Google Cloud PlatformYou are responsible for setting up a CI/CD pipeline for a serverless application deployed on Google Cloud Functions. The application requires multiple stages: development, staging, and production. Each stage uses a separate Google Cloud project for isolation. You need to ensure the pipeline automates deployment, runs unit tests, and promotes code through stages only when tests pass. Which steps should you include in your CI/CD pipeline configuration?
- A
Use Cloud Build to define a pipeline that includes build, test, and deploy steps.
- B
Store environment-specific configuration in a Git repository alongside the source code.
- C
Use Google Cloud Deploy to manage multi-environment rollouts and approvals.
- D
Deploy the same Google Cloud Function version to all environments to ensure consistency.
- E
Use a service account with the least privileges required to deploy to each environment.
Show answer and explanation
Correct answers: A, C, E
Explanation
To set up an effective CI/CD pipeline for serverless applications, you should use tools like Cloud Build and Google Cloud Deploy to automate builds, tests, and deployments. Environment-specific configuration should be securely managed, not stored in the source repository. Deployments should use the principle of least privilege to enhance security. These practices ensure a robust and secure CI/CD process while managing multiple stages effectively.
- A. Correct.
Correct: Cloud Build is a suitable tool for defining CI/CD pipelines in Google Cloud, including build, test, and deployment steps for serverless applications.
- B. Incorrect.
Incorrect: Storing environment-specific configuration in the Git repository may lead to security risks and is not a recommended practice. Instead, use environment variables or secrets management tools.
- C. Correct.
Correct: Google Cloud Deploy provides a native solution for managing multi-environment deployment workflows, including approval processes.
- D. Incorrect.
Incorrect: Deploying the same version to all environments without testing may introduce risks. Each version should be tested in the appropriate environment before promotion.
- E. Correct.
Correct: Using a service account with least privilege ensures secure deployments and adheres to best practices for access control.