Repository navigation
Expand file tree
/
Copy pathconfiguration.tf
More file actions
66 lines (61 loc) · 1.78 KB
/
Copy pathconfiguration.tf
File metadata and controls
66 lines (61 loc) · 1.78 KB
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
locals {
zone_prefix = tomap({
production = "ulises."
default = ""
staging = "test."
development = "beta."
})
availability_zone = tomap({
default = []
production = ["a", "b", "c"]
staging = ["a", "b", "c"]
development = ["a", "b", "c"]
})
cidr_block = tomap({
default = []
production = ["172.10.168.0/24", "172.10.196.0/24", "172.10.223.0/24"]
staging = ["172.10.85.0/24", "172.10.113.0/24", "172.10.140.0/24"]
development = ["172.10.0.0/24", "172.10.28.0/24", "172.10.57.0/24"]
})
settings = tomap({
default = jsonencode({
state = {
name = "lorentz-main"
bucket = "lorentz-state"
}
sdlc = {
users = ["github"]
roles = []
environments = []
workspaces = [terraform.workspace]
}
dns = {
domains = ["zatara.in"]
zones = ["${local.zone_prefix[terraform.workspace]}zatara.in"]
}
networks = ["default"]
availability_zone = local.availability_zone[terraform.workspace]
cidr_block = local.cidr_block[terraform.workspace]
})
})
environments = jsonencode({
state = {
name = "lorentz-${terraform.workspace}"
bucket = ""
}
sdlc = {
users = []
roles = ["github"]
environments = [terraform.workspace]
workspaces = [terraform.workspace]
}
dns = {
domains = []
zones = ["${local.zone_prefix[terraform.workspace]}zatara.in"]
}
networks = []
availability_zone = local.availability_zone[terraform.workspace]
cidr_block = local.cidr_block[terraform.workspace]
})
configuration = jsondecode(lookup(local.settings, terraform.workspace, local.environments))
}