terraform-nomad/environments/root.hcl
Ben Vincent f1f147024c
Some checks failed
Build / build (pull_request) Failing after 30s
feat: initial setup
- manage nomad jobs
- create makefile
- create gitignore
- manage terragrunt environments
- add build jobs
2024-12-28 22:13:49 +11:00

48 lines
927 B
HCL

locals {
vault_addr = "https://vault.service.consul:8200"
nomad_addr = "https://nomad.service.consul:4646"
}
generate "backend" {
path = "backend.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
backend "consul" {
address = "https://consul.service.consul"
path = "infra/terraform/nomad/${path_relative_to_include()}/state"
scheme = "https"
lock = true
ca_file = "/etc/pki/tls/certs/ca-bundle.crt"
}
}
EOF
}
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
required_providers {
vault = {
source = "hashicorp/vault"
version = "~> 4.5.0"
}
nomad = {
source = "hashicorp/nomad"
version = "~> 2.4.0"
}
}
}
provider "vault" {
address = "${local.vault_addr}"
}
provider "nomad" {
address = "${local.nomad_addr}"
#token = var.nomad_token
}
EOF
}