Backend Configs

An Backend Config is a configuration that is used to form a Terraform / OpenTofu backend-config command-line instruction that is used during the init stage. You can define either a Namespace Backend Config (which will be added for all Modules in the Namespace) or a *Module Backend Config.

You can see the full specifications here:

Example Usage: Backend Initialization

For example, let’s assume you wish to initialize Terraform with:

terraform init \
  -backend-config="bucket=my-terraform-state-bucket" \
  -backend-config="key=state/myproject.tfstate" \
  -backend-config="region=us-east-1"

This can be achieved by creating three Backend Config resources in Snap CD:

  1. name: “bucket”, value:“my-terraform-state-bucket”
  2. name: “key”, value:“state/myproject.tfstate”
  3. name: “region”, value:“us-east-1”

Concretely, if you wish to configure this as a Module Backend Config using the Snap CD terraform provider, it would look as follows:

Last updated on