variables.tf 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. variable "profile" {
  2. description = "The AWS profile to use"
  3. }
  4. variable "region" {
  5. description = "The AWS region to run in"
  6. }
  7. variable "common-tags" {
  8. type = map(string)
  9. description = "Tags that go everywhere"
  10. }
  11. variable "open-nets" {
  12. type = list(any)
  13. description = "CIDRs that will have access to everything"
  14. default = []
  15. }
  16. variable "vpc-cidr" {
  17. description = "The CIDR of the VPC"
  18. }
  19. variable "vpc-id" {
  20. description = "The ID of the VPC"
  21. }
  22. variable "vpc-name" {
  23. description = "The Name of the VPC"
  24. }
  25. variable "ssh-key" {
  26. description = "Set if the SSH key you wish to use does not match the VPC name"
  27. default = ""
  28. }
  29. variable "vpc-subnets" {
  30. type = list(any)
  31. description = "The list of subnets available to the VPC"
  32. }
  33. variable "vpc-azs" {
  34. type = list(any)
  35. description = "The ID of the VPC"
  36. }
  37. variable "data-node-count" {
  38. description = "The number of RE data nodes"
  39. default = 3
  40. }
  41. variable "re-instance-type" {
  42. description = "The size of instance to run"
  43. default = "t2.2xlarge"
  44. }
  45. variable "ena-support" {
  46. description = "choose AMIs that have ENA support enabled"
  47. default = false
  48. }
  49. variable "tester-node-type" {
  50. description = "Set this to a type if you want to run a tester node"
  51. default = ""
  52. }
  53. variable "quorum-node-type" {
  54. description = "Set this to a type if you want to use a quorum node"
  55. default = ""
  56. }
  57. variable "re-volume-size" {
  58. description = "The size of the two volumes to attach"
  59. default = "150"
  60. }
  61. variable "node-root-size" {
  62. description = "The size of the root volume"
  63. default = "50"
  64. }
  65. variable "enable-flash" {
  66. description = "Enable Flash Devices"
  67. default = false
  68. }
  69. variable "enable-volumes" {
  70. description = "Enable EBS Devices for Ephemeral and Persistent storage"
  71. default = true
  72. }
  73. variable "flash-iops" {
  74. description = "Enable Flash IOPS"
  75. default = "100"
  76. }
  77. variable "allow-public-ssh" {
  78. description = "Allow SSH to be open to the public - disabled by default"
  79. default = "0"
  80. }
  81. variable "internal-rules" {
  82. description = "Security rules to allow for connectivity within the VPC"
  83. type = list(any)
  84. default = [
  85. {
  86. type = "ingress"
  87. from_port = "22"
  88. to_port = "22"
  89. protocol = "tcp"
  90. comment = "SSH from VPC"
  91. },
  92. {
  93. type = "ingress"
  94. from_port = "1968"
  95. to_port = "1968"
  96. protocol = "tcp"
  97. comment = "Proxy traffic (Internal use)"
  98. },
  99. {
  100. type = "ingress"
  101. from_port = "3333"
  102. to_port = "3341"
  103. protocol = "tcp"
  104. comment = "Cluster traffic (Internal use)"
  105. },
  106. {
  107. type = "ingress"
  108. from_port = "3343"
  109. to_port = "3344"
  110. protocol = "tcp"
  111. comment = "Cluster traffic (Internal use)"
  112. },
  113. {
  114. type = "ingress"
  115. from_port = "36379"
  116. to_port = "36380"
  117. protocol = "tcp"
  118. comment = "Cluster traffic (Internal use)"
  119. },
  120. {
  121. type = "ingress"
  122. from_port = "8001"
  123. to_port = "8001"
  124. protocol = "tcp"
  125. comment = "Traffic from application to RS Discovery Service"
  126. },
  127. {
  128. type = "ingress"
  129. from_port = "8002"
  130. to_port = "8002"
  131. protocol = "tcp"
  132. comment = "System health monitoring"
  133. },
  134. {
  135. type = "ingress"
  136. from_port = "8004"
  137. to_port = "8004"
  138. protocol = "tcp"
  139. comment = "System health monitoring"
  140. },
  141. {
  142. type = "ingress"
  143. from_port = "8006"
  144. to_port = "8006"
  145. protocol = "tcp"
  146. comment = "System health monitoring"
  147. },
  148. {
  149. type = "ingress"
  150. from_port = "8443"
  151. to_port = "8443"
  152. protocol = "tcp"
  153. comment = "Secure (HTTPS) access to the management web UI"
  154. },
  155. {
  156. type = "ingress"
  157. from_port = "8444"
  158. to_port = "8444"
  159. protocol = "tcp"
  160. comment = "nginx <-> cnm_http/cm traffic (Internal use)"
  161. },
  162. {
  163. type = "ingress"
  164. from_port = "9080"
  165. to_port = "9080"
  166. protocol = "tcp"
  167. comment = "nginx <-> cnm_http/cm traffic (Internal use)"
  168. },
  169. {
  170. type = "ingress"
  171. from_port = "9081"
  172. to_port = "9081"
  173. protocol = "tcp"
  174. comment = "For CRDB management (Internal use)"
  175. },
  176. {
  177. type = "ingress"
  178. from_port = "8070"
  179. to_port = "8071"
  180. protocol = "tcp"
  181. comment = "Prometheus metrics exporter"
  182. },
  183. {
  184. type = "ingress"
  185. from_port = "9443"
  186. to_port = "9443"
  187. protocol = "tcp"
  188. comment = "REST API traffic, including cluster management and node bootstrap"
  189. },
  190. {
  191. type = "ingress"
  192. from_port = "10000"
  193. to_port = "19999"
  194. protocol = "tcp"
  195. comment = "Database traffic - if manually creating db ports pare down"
  196. },
  197. {
  198. type = "ingress"
  199. from_port = "20000"
  200. to_port = "29999"
  201. protocol = "tcp"
  202. comment = "Database shards traffic - if manually creating db ports pare down"
  203. },
  204. {
  205. type = "ingress"
  206. from_port = "53"
  207. to_port = "53"
  208. protocol = "udp"
  209. comment = "DNS Traffic"
  210. },
  211. {
  212. type = "ingress"
  213. from_port = "5353"
  214. to_port = "5353"
  215. protocol = "udp"
  216. comment = "DNS Traffic"
  217. },
  218. {
  219. type = "ingress"
  220. from_port = "-1"
  221. to_port = "-1"
  222. protocol = "icmp"
  223. comment = "Ping for connectivity checks between nodes"
  224. },
  225. {
  226. type = "egress"
  227. from_port = "-1"
  228. to_port = "-1"
  229. protocol = "icmp"
  230. comment = "Ping for connectivity checks between nodes"
  231. },
  232. {
  233. type = "egress"
  234. from_port = "0"
  235. to_port = "65535"
  236. protocol = "tcp"
  237. comment = "Let TCP out to the VPC"
  238. },
  239. {
  240. type = "egress"
  241. from_port = "0"
  242. to_port = "65535"
  243. protocol = "udp"
  244. comment = "Let UDP out to the VPC"
  245. },
  246. # {
  247. # type = "ingress"
  248. # from_port = "8080"
  249. # to_port = "8080"
  250. # protocol = "tcp"
  251. # comment = "Allow for host check between nodes"
  252. # },
  253. ]
  254. }
  255. variable "external-rules" {
  256. description = "Security rules to allow for connectivity external to the VPC"
  257. type = list(any)
  258. default = [
  259. {
  260. type = "ingress"
  261. from_port = "53"
  262. to_port = "53"
  263. protocol = "udp"
  264. cidr = ["0.0.0.0/0"]
  265. },
  266. {
  267. type = "egress"
  268. from_port = "0"
  269. to_port = "65535"
  270. protocol = "tcp"
  271. cidr = ["0.0.0.0/0"]
  272. },
  273. {
  274. type = "egress"
  275. from_port = "0"
  276. to_port = "65535"
  277. protocol = "udp"
  278. cidr = ["0.0.0.0/0"]
  279. }
  280. ]
  281. }