vars.tf 4.9 KB

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