forked from shibayan/terraform-azurerm-keyvault-acmebot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
261 lines (222 loc) · 6.16 KB
/
variables.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
variable "function_app_name" {
type = string
description = "The name of the Function App to create."
}
variable "allowed_ip_addresses" {
type = list(string)
description = "A list of allowed ip addresses that can access the Acmebot UI."
default = []
}
variable "app_service_plan_name" {
type = string
description = "The name of the App Service Plan to create."
}
variable "storage_account_name" {
type = string
description = "The name of the Storage Account to create."
}
variable "app_insights_name" {
type = string
description = "The name of the Application Insights to create."
}
variable "workspace_name" {
type = string
description = "The name of the Log Analytics Workspace to create."
}
variable "resource_group_name" {
type = string
description = "Resource group name to be added."
}
variable "auth_settings" {
type = object({
enabled = bool
issuer = string
token_store_enabled = bool
unauthenticated_client_action = string
active_directory = object({
client_id = string
allowed_audiences = list(string)
})
})
description = "Authentication settings for the function app"
default = null
}
variable "app_settings" {
description = "Additional settings to set for the function app"
type = map(string)
default = {}
}
variable "location" {
type = string
description = "Azure region to create resources."
}
variable "vault_uri" {
type = string
description = "URL of the Key Vault to store the issued certificate."
}
variable "mail_address" {
type = string
description = "Email address for ACME account."
}
variable "acme_endpoint" {
type = string
description = "Certification authority ACME Endpoint."
default = "https://acme-v02.api.letsencrypt.org/"
}
variable "environment" {
type = string
description = "The name of the Azure environment."
default = "AzureCloud"
}
variable "time_zone" {
type = string
description = "The name of time zone as the basis for automatic update timing."
default = "UTC"
}
variable "webhook_url" {
type = string
description = "The webhook where notifications will be sent."
default = null
}
variable "mitigate_chain_order" {
type = bool
description = "Mitigate certificate ordering issues that occur with some services."
default = false
}
variable "external_account_binding" {
type = object({
key_id = string
hmac_key = string
algorithm = string
})
default = null
}
# DNS Provider Configuration
variable "azure_dns" {
type = object({
subscription_id = string
})
default = null
}
variable "cloudflare" {
type = object({
api_token = string
})
default = null
}
variable "custom_dns" {
type = object({
endpoint = string
api_key = string
api_key_header_name = string
propagation_seconds = number
})
default = null
}
variable "dns_made_easy" {
type = object({
api_key = string
secret_key = string
})
default = null
}
variable "gandi" {
type = object({
api_key = string
})
default = null
}
variable "go_daddy" {
type = object({
api_key = string
api_secret = string
})
default = null
}
variable "google_dns" {
type = object({
key_file64 = string
})
default = null
}
variable "route_53" {
type = object({
access_key = string
secret_key = string
region = string
})
default = null
}
variable "trans_ip" {
type = object({
customer_name = string
private_key_name = string
})
default = null
}
locals {
external_account_binding = var.external_account_binding != null ? {
"Acmebot:ExternalAccountBinding:KeyId" = var.external_account_binding.key_id
"Acmebot:ExternalAccountBinding:HmacKey" = var.external_account_binding.hmac_key
"Acmebot:ExternalAccountBinding:Algorithm" = var.external_account_binding.algorithm
} : {}
azure_dns = var.azure_dns != null ? {
"Acmebot:AzureDns:SubscriptionId" = var.azure_dns.subscription_id
} : {}
cloudflare = var.cloudflare != null ? {
"Acmebot:Cloudflare:ApiToken" = var.cloudflare.api_token
} : {}
custom_dns = var.custom_dns != null ? {
"Acmebot:CustomDns:Endpoint" = var.custom_dns.endpoint
"Acmebot:CustomDns:ApiKey" = var.custom_dns.api_key
"Acmebot:CustomDns:ApiKeyHeaderName" = var.custom_dns.api_key_header_name
"Acmebot:CustomDns:PropagationSeconds" = var.custom_dns.propagation_seconds
} : {}
dns_made_easy = var.dns_made_easy != null ? {
"Acmebot:DnsMadeEasy:ApiKey" = var.dns_made_easy.api_key
"Acmebot:DnsMadeEasy:SecretKey" = var.dns_made_easy.secret_key
} : {}
gandi = var.gandi != null ? {
"Acmebot:Gandi:ApiKey" = var.gandi.api_key
} : {}
go_daddy = var.go_daddy != null ? {
"Acmebot:GoDaddy:ApiKey" = var.go_daddy.api_key
"Acmebot:GoDaddy:ApiSecret" = var.go_daddy.api_secret
} : {}
google_dns = var.google_dns != null ? {
"Acmebot:GoogleDns:KeyFile64" = var.google_dns.key_file64
} : {}
route_53 = var.route_53 != null ? {
"Acmebot:Route53:AccessKey" = var.route_53.access_key
"Acmebot:Route53:SecretKey" = var.route_53.secret_key
"Acmebot:Route53:Region" = var.route_53.region
} : {}
trans_ip = var.trans_ip != null ? {
"Acmebot:TransIp:CustomerName" = var.trans_ip.customer_name
"Acmebot:TransIp:PrivateKeyName" = var.trans_ip.private_key_name
} : {}
webhook_url = var.webhook_url != null ? {
"Acmebot:Webhook" = var.webhook_url
} : {}
common = {
"Acmebot:Contacts" = var.mail_address
"Acmebot:Endpoint" = var.acme_endpoint
"Acmebot:VaultBaseUrl" = var.vault_uri
"Acmebot:Environment" = var.environment
"Acmebot:MitigateChainOrder" = var.mitigate_chain_order
}
acmebot_app_settings = merge(
local.common,
local.external_account_binding,
local.azure_dns,
local.cloudflare,
local.custom_dns,
local.dns_made_easy,
local.gandi,
local.go_daddy,
local.google_dns,
local.route_53,
local.trans_ip,
local.webhook_url,
)
}