Cluster deployment files

Cluster blueprints represent patterns of infrastructure that you might need to deploy multiple times for different purposes or with different configurations. Deployment files are an optional feature that modify a blueprint's configuration without changing the underlying Terraform and Packer modules. Common use cases for using deployment files include the following:

  • Specifying a deployment_name that must be unique to each deployment
  • Specifying project_id, region, or zone that might vary across deployments
  • Specifying an alternative Terraform remote state configuration

What can be specified in a deployment file

The following shows the parameters that can be set in a deployment file.

vars:
  project_id: PROJECT_ID
  deployment_name: DEPLOYMENT_NAME
  region: REGION
  zone: ZONE

terraform_backend_defaults:
  type: gcs
  configuration:
    bucket: BUCKET_NAME

Using deployment files

Deployment files are supported in Cluster Toolkit v1.29.0 and later. For more information on how to specify the deployment file, see Cluster deployment overview.

Variable precedence

For variables that are specified in the vars section of blueprints and deployment files, the following precedence is enforced:

  • If a variable is specified in both the deployment file and blueprint, the value in the deployment file takes precedence
  • If a variable is specified in the deployment file and the --vars flag of ghpc create or ghpc deploy commands, then the value supplied in the --vars flag takes precedence
  • Any variable that isn't specified in the deployment file or --vars flag, uses the value from the blueprint

If terraform_backend_defaults is set in a deployment file, then it replaces all terraform_backend_defaults settings in the blueprint.