variables.tf 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. # Joinmastodon
  2. variable "name" {
  3. description = "Name of the fastly service (defaults to hostname)."
  4. type = string
  5. default = ""
  6. }
  7. variable "hostname" {
  8. description = "Hostname the service points to."
  9. type = string
  10. }
  11. variable "default_ttl" {
  12. description = "The default Time-to-live (TTL) for requests."
  13. type = number
  14. default = 300
  15. }
  16. variable "backend_name" {
  17. description = "Optional name for the backend."
  18. type = string
  19. default = ""
  20. }
  21. variable "ssl_hostname" {
  22. description = "Hostname to use for SSL verification (if different from 'hostname')."
  23. type = string
  24. default = ""
  25. }
  26. variable "backend_address" {
  27. description = "Address to use for connecting to the backend. Can be a hostname or an IP address."
  28. type = string
  29. }
  30. variable "backend_port" {
  31. description = "The port number on which the Backend responds."
  32. type = number
  33. default = 443
  34. }
  35. variable "shield_region" {
  36. description = "Which Fastly shield region to use. Should correspond with the shield code."
  37. type = string
  38. }
  39. variable "healthcheck_host" {
  40. description = "Host to ping for healthcheck. Defaults to hostname."
  41. type = string
  42. default = ""
  43. }
  44. variable "healthcheck_name" {
  45. description = "Optional name for the healthcheck."
  46. type = string
  47. default = ""
  48. }
  49. variable "healthcheck_path" {
  50. description = "URL to use when doing a healthcheck."
  51. type = string
  52. default = "/"
  53. }
  54. variable "healthcheck_method" {
  55. description = "HTTP method to use when doing a healthcheck."
  56. type = string
  57. default = "GET"
  58. validation {
  59. condition = contains(["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"], var.healthcheck_method)
  60. error_message = "Healthcheck method must be a valid HTTP method"
  61. }
  62. }
  63. variable "healthcheck_expected_response" {
  64. description = "Response to expect from a healthy endpoint."
  65. type = number
  66. default = 200
  67. }
  68. variable "force_tls_hsts" {
  69. description = "Force TLS and HTTP Strict Transport Security (HSTS) to ensure that every request is secure."
  70. type = bool
  71. default = true
  72. }
  73. variable "hsts_duration" {
  74. description = "Number of seconds for the client to remember only to use HTTPS."
  75. type = number
  76. default = 31536000
  77. }
  78. variable "gzip_default_policy" {
  79. description = "Whether to enable Fastly's default gzip policy"
  80. type = bool
  81. default = true
  82. }
  83. variable "product_enablement" {
  84. description = "Which additional Fastly products to enable for this service."
  85. type = object({
  86. brotli_compression = optional(bool, false)
  87. domain_inspector = optional(bool, false)
  88. image_optimizer = optional(bool, false)
  89. origin_inspector = optional(bool, false)
  90. websockets = optional(bool, false)
  91. })
  92. default = {
  93. brotli_compression = false
  94. domain_inspector = false
  95. image_optimizer = false
  96. origin_inspector = false
  97. websockets = false
  98. }
  99. }
  100. variable "datadog" {
  101. description = "Whether to send logging info to Datadog"
  102. type = bool
  103. default = false
  104. }
  105. variable "datadog_token" {
  106. description = "API key from Datadog."
  107. type = string
  108. default = ""
  109. sensitive = true
  110. }
  111. variable "datadog_service" {
  112. description = "Datadog service name to use for logs"
  113. type = string
  114. default = "fastly"
  115. }
  116. variable "datadog_region" {
  117. description = "The region that log data will be sent to."
  118. type = string
  119. default = "EU"
  120. validation {
  121. condition = contains(["US", "EU"], var.datadog_region)
  122. error_message = "Datadog region must be either US or EU."
  123. }
  124. }
  125. # API
  126. variable "api_name" {
  127. description = "Name of the fastly service (defaults to hostname)."
  128. type = string
  129. default = ""
  130. }
  131. variable "api_hostname" {
  132. description = "Hostname the service points to."
  133. type = string
  134. default = ""
  135. }
  136. variable "api_default_ttl" {
  137. description = "The default Time-to-live (TTL) for requests."
  138. type = number
  139. default = 300
  140. }
  141. variable "api_backend_name" {
  142. description = "Optional name for the backend."
  143. type = string
  144. default = ""
  145. }
  146. variable "api_ssl_hostname" {
  147. description = "Hostname to use for SSL verification (if different from 'hostname')."
  148. type = string
  149. default = ""
  150. }
  151. variable "api_backend_address" {
  152. description = "Address to use for connecting to the backend. Can be a hostname or an IP address."
  153. type = string
  154. }
  155. variable "api_backend_port" {
  156. description = "The port number on which the Backend responds."
  157. type = number
  158. default = 443
  159. }
  160. variable "api_backend_ca_cert" {
  161. description = "CA cert to use when connecting to the backend."
  162. type = string
  163. sensitive = true
  164. }
  165. variable "api_shield_region" {
  166. description = "Which Fastly shield region to use (if different than main shield region). Should correspond with the shield code."
  167. type = string
  168. default = ""
  169. }
  170. variable "api_healthcheck_host" {
  171. description = "Host to ping for healthcheck. Defaults to hostname."
  172. type = string
  173. default = ""
  174. }
  175. variable "api_healthcheck_name" {
  176. description = "Optional name for the healthcheck."
  177. type = string
  178. default = ""
  179. }
  180. variable "api_healthcheck_path" {
  181. description = "URL to use when doing a healthcheck."
  182. type = string
  183. default = "/.well-known/health"
  184. }
  185. variable "api_healthcheck_method" {
  186. description = "HTTP method to use when doing a healthcheck."
  187. type = string
  188. default = "GET"
  189. validation {
  190. condition = contains(["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"], var.api_healthcheck_method)
  191. error_message = "Healthcheck method must be a valid HTTP method"
  192. }
  193. }
  194. variable "api_healthcheck_expected_response" {
  195. description = "Response to expect from a healthy endpoint."
  196. type = number
  197. default = 200
  198. }
  199. variable "api_force_tls_hsts" {
  200. description = "Force TLS and HTTP Strict Transport Security (HSTS) to ensure that every request is secure."
  201. type = bool
  202. default = true
  203. }
  204. variable "api_hsts_duration" {
  205. description = "Number of seconds for the client to remember only to use HTTPS."
  206. type = number
  207. default = 31557600
  208. }
  209. variable "api_datadog" {
  210. description = "Whether to send logging info to Datadog"
  211. type = bool
  212. default = false
  213. }
  214. variable "api_datadog_service" {
  215. description = "Datadog service name to use for logs"
  216. type = string
  217. default = "fastly"
  218. }
  219. # Proxy
  220. variable "proxy_name" {
  221. description = "Name of the fastly service (defaults to hostname)."
  222. type = string
  223. default = ""
  224. }
  225. variable "proxy_hostname" {
  226. description = "Hostname the service points to."
  227. type = string
  228. default = ""
  229. }
  230. variable "proxy_default_ttl" {
  231. description = "The default Time-to-live (TTL) for requests."
  232. type = number
  233. default = 300
  234. }
  235. variable "proxy_backend_name" {
  236. description = "Optional name for the backend."
  237. type = string
  238. default = ""
  239. }
  240. variable "proxy_ssl_hostname" {
  241. description = "Hostname to use for SSL verification (if different from 'hostname')."
  242. type = string
  243. default = ""
  244. }
  245. variable "proxy_backend_address" {
  246. description = "Address to use for connecting to the backend. Can be a hostname or an IP address."
  247. type = string
  248. }
  249. variable "proxy_backend_port" {
  250. description = "The port number on which the Backend responds."
  251. type = number
  252. default = 443
  253. }
  254. variable "proxy_shield_region" {
  255. description = "Which Fastly shield region to use (if different than main shield region). Should correspond with the shield code."
  256. type = string
  257. default = ""
  258. }
  259. variable "proxy_healthcheck_host" {
  260. description = "Host to ping for healthcheck. Defaults to hostname."
  261. type = string
  262. default = ""
  263. }
  264. variable "proxy_healthcheck_name" {
  265. description = "Optional name for the healthcheck."
  266. type = string
  267. default = ""
  268. }
  269. variable "proxy_healthcheck_path" {
  270. description = "URL to use when doing a healthcheck."
  271. type = string
  272. default = "/"
  273. }
  274. variable "proxy_healthcheck_method" {
  275. description = "HTTP method to use when doing a healthcheck."
  276. type = string
  277. default = "HEAD"
  278. validation {
  279. condition = contains(["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"], var.proxy_healthcheck_method)
  280. error_message = "Healthcheck method must be a valid HTTP method"
  281. }
  282. }
  283. variable "proxy_healthcheck_expected_response" {
  284. description = "Response to expect from a healthy endpoint."
  285. type = number
  286. default = 404
  287. }
  288. variable "proxy_force_tls_hsts" {
  289. description = "Force TLS and HTTP Strict Transport Security (HSTS) to ensure that every request is secure."
  290. type = bool
  291. default = true
  292. }
  293. variable "proxy_hsts_duration" {
  294. description = "Number of seconds for the client to remember only to use HTTPS."
  295. type = number
  296. default = 31557600
  297. }
  298. variable "proxy_datadog" {
  299. description = "Whether to send logging info to Datadog"
  300. type = bool
  301. default = false
  302. }
  303. variable "proxy_datadog_service" {
  304. description = "Datadog service name to use for logs"
  305. type = string
  306. default = "fastly"
  307. }