This repository has been archived by the owner on Sep 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
terragrunt.hcl
76 lines (69 loc) · 1.55 KB
/
terragrunt.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
terraform {
extra_arguments "conditional_vars" {
commands = [
"apply",
"plan",
"destroy",
"import",
"push",
"refresh"
]
optional_var_files = [
"${get_parent_terragrunt_dir()}/override.tfvars",
"${get_terragrunt_dir()}/override.tfvars",
]
}
}
remote_state {
disable_init = tobool(get_env("CI", "false"))
backend = "swift"
config = {
container = "remote-storage-wars"
archive_container = "remote-storage-wars-archive"
# Each child terraform plan will be stored in it's dedicated file, hence
# specifying a state_name using path_relative_to_include(). The ternary aims
# to avoid having a file named `.tfstate`.
state_name = "${path_relative_to_include()}" == "." ? "root.tfstate" : "${path_relative_to_include()}.tfstate"
}
generate = {
path = "backend.tf"
if_exists = "overwrite"
}
}
generate "common" {
path = "common.tf"
contents = file("common.hcl")
if_exists = "overwrite"
}
generate "version" {
path = "versions.tf"
if_exists = "skip"
contents = <<EOF
terraform {
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 1.31"
}
ovh = {
source = "ovh/ovh"
version = "~> 0.9.1"
}
}
required_version = ">= 0.14"
}
EOF
}
generate "provider" {
path = "providers.tf"
if_exists = "skip"
contents = <<EOF
provider "openstack" {
cloud = var.cloud
region = var.region_name
}
provider "ovh" {
endpoint = var.ovh_endpoint
}
EOF
}