An enterprise cloud team is creating reusable Google Cloud Deployment Manager templates (`storage_bucket.jinja`) to standardize Cloud Storage bucket deployments across multiple projects. The team wants to enforce parameter validation—such as requiring the `storage_class` input parameter and verifying allowed string values—so that invalid configuration files fail prior to resource creation. Which approach correctly implements this pre-deployment parameter validation in Deployment Manager?
- Create a companion schema file named `storage_bucket.jinja.schema` that defines mandatory properties and allowed values using JSON Schema.Answer
- BAppend the `--validate-schema` flag to the `gcloud deployment-manager deployments create` command during deployment execution.
- CSet `enforce_uniform_bucket_level_access = true` inside the properties block of the top-level YAML configuration file.
- DEnable the Cloud Resource Manager API in the parent Google Cloud Organization resource node.
Answer
Create a companion schema file named `storage_bucket.jinja.schema` that defines mandatory properties and allowed values using JSON Schema.
In Google Cloud Deployment Manager, schema files (`.schema`) written in JSON Schema format allow authors to define rules for template properties. By creating `storage_bucket.jinja.schema`, Deployment Manager validates that required fields (such as `storage_class`) are present and conform to specified constraints before applying the deployment.
Step-by-Step Solution
Key Concept
Deployment Manager Schema Validation