-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvariables.tf
93 lines (80 loc) · 2.55 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
# Required variables
variable "hostname" {
type = string
description = "Hostname for accessing Traefik e.g. traefik.example.com"
}
variable "acme_email" {
type = string
description = "Let's Encrypt email address used for registration."
}
# Optional variables
variable "networks" {
type = set(string)
description = "List of additional networks to connect Traefik to."
default = []
}
variable "traefik_network" {
type = string
description = "Traefik (Docker overlay) network name."
default = "traefik"
}
variable "traefik_network_attachable" {
type = bool
description = "Make the default Traefik network attachable?"
default = false
}
variable "traefik_version" {
type = string
description = "Traefik Docker image version."
default = "2.10.3" # https://github.com/traefik/traefik/releases/latest
}
variable "password" {
type = string
description = "Password to login to Traefik dashboard (username: admin)"
default = "traefik"
sensitive = true
}
variable "live_cert" {
type = bool
description = "Configure the Traefik instance with a live SSL certificate?"
default = false # Prevents hitting Let's Encrypts rate limit when testing.
}
variable "lets_encrypt_keytype" {
type = string
description = "The SSL certificate key type Let's Encrypt issues: EC256, EC384, RSA2048, RSA4096, RSA8192"
default = "RSA2048"
validation {
condition = length(regexall("^EC256|EC384|RSA2048|RSA4096|RSA8192$", var.lets_encrypt_keytype)) > 0
error_message = "Invalid key type value. Valid Let's Encrypt key types are EC256, EC384, RSA2048, RSA4096, RSA8192."
}
}
variable "lets_encrypt_resolvers" {
type = list(string)
description = "A list of DNS Challange providers to enable in the Traefik configuration"
default = []
validation {
condition = can([for provider in var.lets_encrypt_resolvers : regex("^cloudflare$", provider)])
error_message = "Invalid/Unsupported DNS Provider listed. Supported values are: cloudflare."
}
}
# Cloudflare DNS Variables
variable "cloudflare_dns_token" {
type = string
description = "Cloudflare DNS Token"
default = ""
}
variable "cloudflare_zone_token" {
type = string
description = "Cloudflare ZONE Token"
default = ""
}
variable "cloudflare_email" {
type = string
description = "Cloudflare Account Email"
default = ""
}
variable "cloudflare_api_key" {
type = string
description = "Cloudflare Global API Key"
default = ""
}