-
Notifications
You must be signed in to change notification settings - Fork 0
/
terraform.hcl
36 lines (34 loc) · 1.13 KB
/
terraform.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
locals {
secrets = {
digitalocean = jsondecode(sops_decrypt_file("${get_parent_terragrunt_dir()}/secrets/digitalocean.sops.json"))
github = jsondecode(sops_decrypt_file("${get_parent_terragrunt_dir()}/secrets/github.sops.json"))
}
}
remote_state {
backend = "s3"
config = {
bucket = "e91e63"
encrypt = true
endpoint = "https://sfo3.digitaloceanspaces.com"
key = "tfstates/${path_relative_to_include()}/terraform.tfstate"
region = "us-east-1"
skip_region_validation = true
skip_credentials_validation = true
skip_metadata_api_check = true
}
generate = {
if_exists = "overwrite"
path = "backend.tf"
}
}
// TODO: split this out with multi-level-includes
// https://github.com/gruntwork-io/terragrunt/issues/1566
terraform {
extra_arguments "secrets" {
commands = get_terraform_commands_that_need_vars()
env_vars = {
DIGITALOCEAN_TOKEN = local.secrets.digitalocean.DIGITALOCEAN_TOKEN
GITHUB_TOKEN = local.secrets.github.GITHUB_TOKEN
}
}
}