Skip to content

Backends

File: searching in ./*.yaml. Optional.

Backend is an object that describes backend storage for Terraform and Cluster.dev states. A backend could be local or remote, depending on where it stores a state.

You can use any options of Terraform backends in the remote backend configuration. The options will be mapped to a generated Terraform backend and converted as is.

Local backend

Local backend stores the cluster state on a local file system in the .cluster.dev/states/cdev-state.json file. Cluster.dev will use the local backend by default unless the remote backend is specified in the project.yaml.

Example configuration:

name: my-fs
kind: backend
provider: local
spec: 
  path: /home/cluster.dev/states/

A path should be absolute or relative to the directory where cdev is running. An absolute path must begin with /, and a relative with ./ or ../.

Remote backend

Remote backend uses remote cloud services to store the cluster state, making it accessible for team work.

Currently you can use only S3 bucket as a remote backend. In the future we plan to add other remote backend options that are listed below.

s3

Stores the cluster state in AWS S3 bucket.

name: aws-backend
kind: backend
provider: s3
spec:
  bucket: cdev-states
  region: {{ .project.variables.region }}

azurerm

Stores the cluster state in Microsoft Azure cloud. You can also use any options of Terraform azurerm backend.

name: azurerm-b
kind: backend
provider: azurerm
spec:
  resource_group_name: "StorageAccount-ResourceGroup"
  storage_account_name: "example"
  container_name: "cdev-states"

gcs

Stores the cluster state in Google Cloud service. You can also use any options of Terraform gcs backend.

name: gcs-b
kind: backend
provider: gcs
spec:
  bucket: cdev-states
  prefix: pref

do

Stores the cluster state in DigitalOcean spaces.

name: do-backend
kind: backend
provider: do
spec:
  bucket: cdev-states
  region: {{ .project.variables.region }}
  access_key: {{ env "SPACES_ACCESS_KEY_ID" }}
  secret_key: {{ env "SPACES_SECRET_ACCESS_KEY" }}