-
Notifications
You must be signed in to change notification settings - Fork 4
/
vars.tf
188 lines (167 loc) · 5.37 KB
/
vars.tf
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
data "coder_provisioner" "ii" {
}
data "coder_workspace" "ii" {
}
# Warning: Deprecated Resource
# on vars.tf line 7, in data "coder_git_auth" "github":
# data "coder_git_auth" "github" {
# # Matches the ID of the git auth provider in Coder.
# id = "github"
# }
# data "coder_external_auth" "github" {
# id = "github"
# }
# Can be set via TF_VAR_variable_name in the coder process ENV
# But can also be set via a file similar var/space.sharing.io.yaml
# And deployed with coder template push --variables-file ./vars/space.sharing.io.yaml or similar
locals {
username = lower(data.coder_workspace.ii.owner)
namespace = lower(data.coder_workspace.ii.owner)
spacename = lower(data.coder_workspace.ii.name)
user_domain = "${local.namespace}.${var.coder_domain}"
space_domain = "${local.spacename}.${local.user_domain}"
iipod_agent_init = coder_agent.iipod.init_script
iipod_agent_token = coder_agent.iipod.token
# public_ip = var.public_ip
# coder_url = var.coder_url
# metal_ip = equinix_metal_device.iibox.access_public_ipv4
# iibox_agent_init = coder_agent.iibox.init_script
# iibox_agent_token = coder_agent.iibox.token
}
variable "coder_url" {
type = string
description = "URL you login into coder with"
nullable = false
validation {
condition = can(regex("(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]", var.coder_url))
error_message = "Invalid input, must include a valid domain name."
}
}
variable "coder_domain" {
type = string
description = "Domain to create NS records and TLS certs within as USER.$${coder_domain}"
nullable = false
validation {
condition = can(regex("(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]", var.coder_domain))
error_message = "Invalid input, must be a valid domain name."
}
}
variable "openai_api_token" {
type = string
description = "OpenAI API Token"
# default = "example.com"
nullable = true
}
variable "pdns_api_key" {
type = string
description = "PowerDNS API Key for Powerdns Domain Creation"
# default = "example.com"
nullable = false
}
variable "pdns_api_url" {
type = string
description = "PowerDNS API URL for Powerdns Domain Creation"
# default = "https://pdns.ii.nz/"
nullable = false
}
# variable "dns_update_account" {
# type = string
# description = "PowerDNS Account to associate user domain to"
# nullable = false
# }
variable "dns_update_server" {
type = string
description = "Nameserver for RFC2136 Updates"
# default = "123.253.176.253"
nullable = false
validation {
condition = can(regex("(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]", var.dns_update_server))
error_message = "Invalid input, must be a valid domain name."
}
}
variable "dns_update_keyname" {
type = string
description = "TSIG Key Name for RFC2136 Updates"
nullable = false
}
variable "dns_update_keyalgorithm" {
type = string
description = "TSIG Algorithm for RFC2136 Updates"
nullable = false
# default = "hmac-sha256"
}
variable "dns_update_keysecret" {
type = string
description = "TSIG Key Secret for RFC2136 Updates"
nullable = false
# sensitive = true
}
variable "container_resource_cpu" {
type = number
description = "the strict amount of CPU to provide"
default = "4"
nullable = false
# sensitive = true
}
variable "container_resource_memory" {
type = number
description = "the strict amount of memory to provide in gigabytes"
default = "8"
nullable = false
# sensitive = true
}
variable "default_container_image" {
type = string
description = "Default container image to use for the workspace"
nullable = false
validation {
condition = can(
regex("(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]",
var.default_container_image))
error_message = "Invalid input, must contain a valid domain name."
}
}
variable "default_git_url" {
type = string
description = "Default container image to use for the workspace"
nullable = false
validation {
condition = can(
regex("(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]",
var.default_git_url))
error_message = "Invalid input, must contain a valid domain name."
}
}
variable "default_org_url" {
type = string
description = "Default container image to use for the workspace"
nullable = false
validation {
condition = can(
regex("(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]",
var.default_org_url))
error_message = "Invalid input, must contain a valid domain name."
}
}
# variable "ingress_ip" {
# type = string
# description = "Local LB IP"
# nullable = false
# validation {
# condition = can(cidrhost("${var.ingress_ip}/32", 0))
# error_message = "Must be valid IP Address"
# }
# }
variable "public_ip" {
type = string
description = "Public IP"
nullable = false
validation {
condition = can(cidrhost("${var.public_ip}/32", 0))
error_message = "Must be valid IP Address"
}
}
variable "privileged" {
type = bool
description = "Whether to deploy a privileged environment"
}