Google Professional Cloud DevOps Engineer Question 155
Select 3Google Cloud PlatformYour team has implemented a CI/CD pipeline in Google Cloud using Cloud Build. Recently, deployments to the production environment have been failing intermittently. Upon investigation, you notice that the failures are due to missing environment-specific configuration variables during the build process. What steps should you take to resolve this issue?
- A
Use Google Secret Manager to store environment-specific variables and retrieve them securely during the build process.
- B
Hardcode the environment-specific variables directly into the CI/CD pipeline YAML file to ensure they are always available.
- C
Set up separate substitution variables for each environment in the Cloud Build trigger configuration.
- D
Use a pre-build step to fetch environment-specific variables from a configuration file hosted in a private Cloud Storage bucket.
- E
Skip validation of environment variables in the production stage to avoid interruptions in deployment.
Show answer and explanation
Correct answers: A, C, D
Explanation
The issue arises from missing environment-specific variables during the build process. To resolve this, you should adopt best practices for managing and injecting configuration variables in a secure and scalable way. Using Google Secret Manager, setting up substitution variables, or retrieving variables from a secure source during a pre-build step are all valid solutions that align with Google Cloud best practices. Avoid hardcoding variables or bypassing validation as these approaches introduce risks and reduce maintainability.
- A. Correct.
Using Google Secret Manager is a secure and recommended way to store and retrieve sensitive environment-specific variables during CI/CD processes.
- B. Incorrect.
Hardcoding environment-specific variables is not recommended as it poses security risks and reduces flexibility when managing configurations.
- C. Correct.
Setting up substitution variables in Cloud Build trigger configurations allows dynamic injection of environment-specific variables, which is a best practice.
- D. Correct.
Using a pre-build step to fetch environment-specific variables from a secure location, like a private Cloud Storage bucket, is another valid approach to ensure the variables are available during the build process.
- E. Incorrect.
Skipping validation of environment variables is not a good practice as it can lead to unpredictable deployments and further issues in production.