variables.tf 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. # API
  101. variable "api_name" {
  102. description = "Name of the fastly service (defaults to hostname)."
  103. type = string
  104. default = ""
  105. }
  106. variable "api_hostname" {
  107. description = "Hostname the service points to."
  108. type = string
  109. default = ""
  110. }
  111. variable "api_default_ttl" {
  112. description = "The default Time-to-live (TTL) for requests."
  113. type = number
  114. default = 300
  115. }
  116. variable "api_backend_name" {
  117. description = "Optional name for the backend."
  118. type = string
  119. default = ""
  120. }
  121. variable "api_ssl_hostname" {
  122. description = "Hostname to use for SSL verification (if different from 'hostname')."
  123. type = string
  124. default = ""
  125. }
  126. variable "api_backend_address" {
  127. description = "Address to use for connecting to the backend. Can be a hostname or an IP address."
  128. type = string
  129. }
  130. variable "api_backend_port" {
  131. description = "The port number on which the Backend responds."
  132. type = number
  133. default = 443
  134. }
  135. variable "api_backend_ca_cert" {
  136. description = "CA cert to use when connecting to the backend."
  137. type = string
  138. sensitive = true
  139. }
  140. variable "api_shield_region" {
  141. description = "Which Fastly shield region to use (if different than main shield region). Should correspond with the shield code."
  142. type = string
  143. default = ""
  144. }
  145. variable "api_healthcheck_host" {
  146. description = "Host to ping for healthcheck. Defaults to hostname."
  147. type = string
  148. default = ""
  149. }
  150. variable "api_healthcheck_name" {
  151. description = "Optional name for the healthcheck."
  152. type = string
  153. default = ""
  154. }
  155. variable "api_healthcheck_path" {
  156. description = "URL to use when doing a healthcheck."
  157. type = string
  158. default = "/.well-known/health"
  159. }
  160. variable "api_healthcheck_method" {
  161. description = "HTTP method to use when doing a healthcheck."
  162. type = string
  163. default = "GET"
  164. validation {
  165. condition = contains(["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"], var.api_healthcheck_method)
  166. error_message = "Healthcheck method must be a valid HTTP method"
  167. }
  168. }
  169. variable "api_healthcheck_expected_response" {
  170. description = "Response to expect from a healthy endpoint."
  171. type = number
  172. default = 200
  173. }
  174. variable "api_force_tls_hsts" {
  175. description = "Force TLS and HTTP Strict Transport Security (HSTS) to ensure that every request is secure."
  176. type = bool
  177. default = true
  178. }
  179. variable "api_hsts_duration" {
  180. description = "Number of seconds for the client to remember only to use HTTPS."
  181. type = number
  182. default = 31557600
  183. }
  184. # Proxy
  185. variable "proxy_name" {
  186. description = "Name of the fastly service (defaults to hostname)."
  187. type = string
  188. default = ""
  189. }
  190. variable "proxy_hostname" {
  191. description = "Hostname the service points to."
  192. type = string
  193. default = ""
  194. }
  195. variable "proxy_default_ttl" {
  196. description = "The default Time-to-live (TTL) for requests."
  197. type = number
  198. default = 300
  199. }
  200. variable "proxy_backend_name" {
  201. description = "Optional name for the backend."
  202. type = string
  203. default = ""
  204. }
  205. variable "proxy_ssl_hostname" {
  206. description = "Hostname to use for SSL verification (if different from 'hostname')."
  207. type = string
  208. default = ""
  209. }
  210. variable "proxy_backend_address" {
  211. description = "Address to use for connecting to the backend. Can be a hostname or an IP address."
  212. type = string
  213. }
  214. variable "proxy_backend_port" {
  215. description = "The port number on which the Backend responds."
  216. type = number
  217. default = 443
  218. }
  219. variable "proxy_shield_region" {
  220. description = "Which Fastly shield region to use (if different than main shield region). Should correspond with the shield code."
  221. type = string
  222. default = ""
  223. }
  224. variable "proxy_healthcheck_host" {
  225. description = "Host to ping for healthcheck. Defaults to hostname."
  226. type = string
  227. default = ""
  228. }
  229. variable "proxy_healthcheck_name" {
  230. description = "Optional name for the healthcheck."
  231. type = string
  232. default = ""
  233. }
  234. variable "proxy_healthcheck_path" {
  235. description = "URL to use when doing a healthcheck."
  236. type = string
  237. default = "/"
  238. }
  239. variable "proxy_healthcheck_method" {
  240. description = "HTTP method to use when doing a healthcheck."
  241. type = string
  242. default = "HEAD"
  243. validation {
  244. condition = contains(["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"], var.proxy_healthcheck_method)
  245. error_message = "Healthcheck method must be a valid HTTP method"
  246. }
  247. }
  248. variable "proxy_healthcheck_expected_response" {
  249. description = "Response to expect from a healthy endpoint."
  250. type = number
  251. default = 404
  252. }
  253. variable "proxy_force_tls_hsts" {
  254. description = "Force TLS and HTTP Strict Transport Security (HSTS) to ensure that every request is secure."
  255. type = bool
  256. default = true
  257. }
  258. variable "proxy_hsts_duration" {
  259. description = "Number of seconds for the client to remember only to use HTTPS."
  260. type = number
  261. default = 31557600
  262. }