-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterragrunt-local.hcl
44 lines (40 loc) · 957 Bytes
/
terragrunt-local.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
37
38
39
40
41
42
43
44
# Read the local "env.yaml" in every environment.
locals {
vars = yamldecode(file("${path_relative_to_include()}/env.yaml"))
environment = local.vars.environment
url = local.vars.url
client_id = local.vars.terraform-client-id
client_secret = local.vars.terraform-client-secret
}
# Generate the "provider.tf" file for every module.
generate "provider" {
path = "provider.tf"
if_exists = "overwrite"
contents = <<EOF
terraform {
required_providers {
keycloak = {
source = "mrparkers/keycloak"
version = "4.4.0"
}
}
}
provider "keycloak" {
client_id = "${local.client_id}"
client_secret = "${local.client_secret}"
url = "${local.url}"
}
EOF
}
# Generate the "backend.tf" file for every module.
generate "backend" {
path = "backend.tf"
if_exists = "overwrite"
contents = <<EOF
terraform {
backend "local" {
workspace_dir = "./terraform.tfstate"
}
}
EOF
}