Skip to content

Instantly share code, notes, and snippets.

View soerenmartius's full-sized avatar
🎯
focused

Sören Martius soerenmartius

🎯
focused
View GitHub Profile
@soerenmartius
soerenmartius / globals.hcl.tm
Last active July 14, 2022 11:18
Terramate Globals Examples
globals {
env = "staging"
}
@soerenmartius
soerenmartius / github_as_code_user_management.hcl
Created July 11, 2022 16:36
GitHub as Code configuration example
# This file is part of Terramate Configuration.
# Terramate is an orchestrator and code generator for Terraform.
# Please see https://github.com/mineiros-io/terramate for more information.
#
# To generate/update Terraform code within the stacks run `terramate generate` from the repositories root directory.
### USER MAPS ################################################################
#
# As GitHub usernames are hard to maintain we generate mappings here to real names.
# This will help maintain large lists of users and improve on-/off-boardings.
@soerenmartius
soerenmartius / settings.json
Created June 29, 2022 12:47
Configure *.tm.hcl files with the Terramate Language Server in VSCode
"files.associations": {
"*.tm.hcl": "terramate"
}
@soerenmartius
soerenmartius / install_terramate_with_go.sh
Created June 29, 2022 12:37
Install the Terramate Language Server from the sources with Go
go install github.com/mineiros-io/terramate-ls/cmd/terramate-ls@v0.0.2
@soerenmartius
soerenmartius / install_terramate_via_github.sh
Last active June 29, 2022 12:33
Install Terramate Language Server via GitHub Releases
curl -L -o terramate-ls.tar.gz https://github.com/mineiros-io/terramate-ls/releases/download/v0.0.2/terramate-ls_0.0.2_linux_x86_64.tar.gz
tar xvf terramate-ls.tar.gz
sudo cp terramate-ls /usr/bin
@soerenmartius
soerenmartius / terramate.tm.hcl
Created May 5, 2022 12:30
This examples shows how to define the order of execution in Terramate using the after block
stack {
name = "My production VPC"
after = [
"/stacks/gcp-projects/my-staging/my-vpc",
]
}
@soerenmartius
soerenmartius / backend.tf
Created May 5, 2022 12:27
backend.tf file generated by Terramate
// TERRAMATE: GENERATED AUTOMATICALLY DO NOT EDIT
// TERRAMATE: originated from generate_hcl block on /stacks/config.tm
terraform {
backend "gcs" {
bucket = "my-state-bucket"
prefix = "stacks/gcp-projects/my-prod/my-vpc"
}
}
@soerenmartius
soerenmartius / backend.tf
Created May 5, 2022 12:26
backend.tf file generated by Terramate
// TERRAMATE: GENERATED AUTOMATICALLY DO NOT EDIT
// TERRAMATE: originated from generate_hcl block on /stacks/config.tm
terraform {
backend "gcs" {
bucket = "my-state-bucket"
prefix = "stacks/gcp-projects/my-staging/my-vpc"
}
}
@soerenmartius
soerenmartius / advanced_example_config.tm.hcl
Created May 5, 2022 12:24
This example shows some advanced features of Terramate.
# file: stacks/config.tm
globals {
# define a bucket name that is used when generating backend.tf defined below
gcs_bucket_name = "my-state-bucket"
# the following will calculate the path name of each stack
# but remove the / prefix as gcs does not handle this well
gcs_bucket_prefix = tm_substr(terramate.path, 1, -1)
}
@soerenmartius
soerenmartius / example_stack.tm.hcl
Created May 5, 2022 12:22
This Example shows how to define a basic stack with Terramate
stack {
name = "My stack"
description = "My stack description"
}