vars.tf 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. variable "name" {
  2. description = "The shortname for DNS and resources."
  3. type = string
  4. }
  5. variable "subject_alternative_names" {
  6. description = "List of alternative names for the certificate."
  7. type = list(string)
  8. default = []
  9. }
  10. variable "redirect_80" {
  11. description = "True sets up a redirect from 80 to listener port"
  12. type = bool
  13. default = false
  14. }
  15. variable "extra_security_groups" {
  16. description = "Creates extra security groups for modification outside the module."
  17. type = number
  18. default = 0
  19. }
  20. variable "target_ids" {
  21. description = "List of targets to assign to the ALB"
  22. type = set(string)
  23. }
  24. variable "allow_from_any" {
  25. description = "Open the ALB to 0.0.0.0/0? If not, you must create your own rules."
  26. type = bool
  27. default = true
  28. }
  29. variable "listener_port" {
  30. description = "Public Facing Port"
  31. type = number
  32. }
  33. variable "target_port" {
  34. description = "Port on Instance"
  35. type = number
  36. }
  37. variable "target_protocol" {
  38. description = "Protocol on Instance"
  39. type = string
  40. }
  41. variable "target_security_group" {
  42. description = "A target security group to allow egress from the ALB"
  43. type = string
  44. }
  45. # Health Check Variables have sane defaults
  46. variable "healthcheck_port" {
  47. description = "Health Check Port on Instance"
  48. type = number
  49. default = null
  50. }
  51. variable "healthcheck_protocol" {
  52. description = "Health Check Protocol on Instance"
  53. type = string
  54. default = null
  55. }
  56. variable "healthcheck_path" {
  57. description = "Health Check Path on Instance"
  58. type = string
  59. default = "/"
  60. }
  61. variable "healthcheck_matcher" {
  62. description = "Health Check Match Conditions"
  63. type = string
  64. default = "200,302"
  65. }
  66. variable "stickiness" {
  67. description = "Session Stickiness enabled?"
  68. type = bool
  69. default = false
  70. }
  71. locals {
  72. healthcheck_port = var.healthcheck_port == null ? var.target_port : var.healthcheck_port
  73. healthcheck_protocol = var.healthcheck_protocol == null ? var.target_protocol : var.healthcheck_protocol
  74. }
  75. # WAF passthrough variables
  76. variable "waf_enabled" {
  77. type = bool
  78. description = "Enable the standard WAF?"
  79. }
  80. variable "fqdns" {
  81. description = "List of FQDNs to allow through the WAF"
  82. type = list(string)
  83. default = [] # Default will allow nothing through, so only valid if waf_enabled is false
  84. }
  85. ## Excluded Rules
  86. variable "excluded_rules_AWSManagedRulesCommonRuleSet" {
  87. type = list(string)
  88. default = [
  89. "SizeRestrictions_BODY" # Breaks too many things
  90. ]
  91. }
  92. variable "excluded_rules_AWSManagedRulesAmazonIpReputationList" {
  93. type = list(string)
  94. default = []
  95. }
  96. variable "excluded_rules_AWSManagedRulesKnownBadInputsRuleSet" {
  97. type = list(string)
  98. default = []
  99. }
  100. variable "excluded_rules_AWSManagedRulesSQLiRuleSet" {
  101. type = list(string)
  102. default = []
  103. }
  104. variable "excluded_rules_AWSManagedRulesLinuxRuleSet" {
  105. type = list(string)
  106. default = []
  107. }
  108. variable "excluded_rules_AWSManagedRulesUnixRuleSet" {
  109. type = list(string)
  110. default = []
  111. }
  112. ## Exclude Entire Sets
  113. variable "excluded_set_AWSManagedRulesCommonRuleSet" {
  114. type = bool
  115. default = null
  116. }
  117. variable "excluded_set_AWSManagedRulesAmazonIpReputationList" {
  118. type = bool
  119. default = null
  120. }
  121. variable "excluded_set_AWSManagedRulesKnownBadInputsRuleSet" {
  122. type = bool
  123. default = null
  124. }
  125. variable "excluded_set_AWSManagedRulesSQLiRuleSet" {
  126. type = bool
  127. default = null
  128. }
  129. variable "excluded_set_AWSManagedRulesLinuxRuleSet" {
  130. type = bool
  131. default = null
  132. }
  133. variable "excluded_set_AWSManagedRulesUnixRuleSet" {
  134. type = bool
  135. default = null
  136. }
  137. variable "block_settings" {
  138. type = object(
  139. {
  140. default = bool, # Default action. False = count
  141. custom = bool, # XDR Custom Rules. False = count
  142. admin = bool, # Block /admin access to admin IPs
  143. AWSManagedRulesCommonRuleSet = bool,
  144. AWSManagedRulesAmazonIpReputationList = bool,
  145. AWSManagedRulesKnownBadInputsRuleSet = bool,
  146. AWSManagedRulesSQLiRuleSet = bool,
  147. AWSManagedRulesLinuxRuleSet = bool,
  148. AWSManagedRulesUnixRuleSet = bool,
  149. }
  150. )
  151. default = null
  152. }
  153. variable "additional_blocked_ips" {
  154. description = "IP addresses that are blocked, in addition to the defaults."
  155. type = list(string)
  156. default = []
  157. }
  158. variable "allowed_ips" {
  159. description = "IP Addresses that are always allowed"
  160. type = list(string)
  161. default = []
  162. }
  163. variable "admin_ips" {
  164. description = "IP Addressed that are allowed to the admin interface"
  165. type = list(string)
  166. default = []
  167. }
  168. # Inherited variables
  169. variable "dns_info" { type = map(any) }
  170. variable "tags" { type = map(any) }
  171. variable "public_subnets" { type = list(any) }
  172. variable "environment" { type = string }
  173. variable "vpc_id" { type = string }
  174. variable "aws_partition" { type = string }
  175. variable "aws_region" { type = string }
  176. variable "aws_account_id" { type = string }