
Ultimate access to all questions.
You are developing an application that will be deployed on Compute Engine instances across multiple distinct projects, each representing a different environment in your software development lifecycle (development, QA, staging, and production). The instances in each project run the same application code but require environment-specific configurations. During deployment, each instance should automatically receive the appropriate configuration for its environment. How can you achieve this with minimal configuration steps?
A
When creating your instances, configure a startup script using the gcloud command to determine the project name that indicates the correct environment.
B
In each project, configure a metadata key ג€environmentג€ whose value is the environment it serves. Use your deployment tool to query the instance metadata and configure the application based on the ג€environmentג€ value.
C
Deploy your chosen deployment tool on an instance in each project. Use a deployment job to retrieve the appropriate configuration file from your version control system, and apply the configuration when deploying the application on each instance.
D
During each instance launch, configure an instance custom-metadata key named ג€environmentג€ whose value is the environment the instance serves. Use your deployment tool to query the instance metadata, and configure the application based on the ג€environmentג€ value.