Skip to content

Instantly share code, notes, and snippets.

@soerenmartius
Created July 14, 2022 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soerenmartius/c281186db11fe9ff5f3084cad3ef43f8 to your computer and use it in GitHub Desktop.
Save soerenmartius/c281186db11fe9ff5f3084cad3ef43f8 to your computer and use it in GitHub Desktop.
Generate Terraform backend.tf files with Terramate
# File: /projects/backend.tm.hcl
# The file is prefixed with _terramate_generated here to make the generated nature
# of it more visible
generate_hcl "_terramate_generated_backend.tf" {
content {
terraform {
backend "gcs" {
bucket = "tf-state-${global.project_id}"
prefix = terramate.stack.path.absolute
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment