Skip to content

Instantly share code, notes, and snippets.

@soerenmartius
Created July 14, 2022 12:31
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/8ddccfacb4263284e34dce28f5e8895e to your computer and use it in GitHub Desktop.
Save soerenmartius/8ddccfacb4263284e34dce28f5e8895e to your computer and use it in GitHub Desktop.
Generate Terraform locals with Terramate
# File: /projects/locals.tm.hcl
# Export env and project_id to be referenced as local.project_id and local.env
# in main.tf and other Terraform files in each stack.
generate_hcl "_terramate_generated_locals" {
content {
locals {
env = global.env
project_id = global.project_id
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment