variables.tf 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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
  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
  31. description = "The list of subnets available to the VPC"
  32. }
  33. variable "vpc-azs" {
  34. type = list
  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 "enable-flash" {
  62. description = "Enable Flash Devices"
  63. default = false
  64. }
  65. variable "enable-volumes" {
  66. description = "Enable EBS Devices for Ephemeral and Persistent storage"
  67. default = true
  68. }
  69. variable "flash-iops" {
  70. description = "Enable Flash IOPS"
  71. default = "100"
  72. }
  73. variable "allow-public-ssh" {
  74. description = "Allow SSH to be open to the public - disabled by default"
  75. default = "0"
  76. }
  77. variable "internal-rules" {
  78. description = "Security rules to allow for connectivity within the VPC"
  79. type = list
  80. default = [
  81. {
  82. type = "ingress"
  83. from_port = "22"
  84. to_port = "22"
  85. protocol = "tcp"
  86. comment = "SSH from VPC"
  87. },
  88. {
  89. type = "ingress"
  90. from_port = "1968"
  91. to_port = "1968"
  92. protocol = "tcp"
  93. comment = "Proxy traffic (Internal use)"
  94. },
  95. {
  96. type = "ingress"
  97. from_port = "3333"
  98. to_port = "3341"
  99. protocol = "tcp"
  100. comment = "Cluster traffic (Internal use)"
  101. },
  102. {
  103. type = "ingress"
  104. from_port = "3343"
  105. to_port = "3344"
  106. protocol = "tcp"
  107. comment = "Cluster traffic (Internal use)"
  108. },
  109. {
  110. type = "ingress"
  111. from_port = "36379"
  112. to_port = "36380"
  113. protocol = "tcp"
  114. comment = "Cluster traffic (Internal use)"
  115. },
  116. {
  117. type = "ingress"
  118. from_port = "8001"
  119. to_port = "8001"
  120. protocol = "tcp"
  121. comment = "Traffic from application to RS Discovery Service"
  122. },
  123. {
  124. type = "ingress"
  125. from_port = "8002"
  126. to_port = "8002"
  127. protocol = "tcp"
  128. comment = "System health monitoring"
  129. },
  130. {
  131. type = "ingress"
  132. from_port = "8004"
  133. to_port = "8004"
  134. protocol = "tcp"
  135. comment = "System health monitoring"
  136. },
  137. {
  138. type = "ingress"
  139. from_port = "8006"
  140. to_port = "8006"
  141. protocol = "tcp"
  142. comment = "System health monitoring"
  143. },
  144. {
  145. type = "ingress"
  146. from_port = "8443"
  147. to_port = "8443"
  148. protocol = "tcp"
  149. comment = "Secure (HTTPS) access to the management web UI"
  150. },
  151. {
  152. type = "ingress"
  153. from_port = "8444"
  154. to_port = "8444"
  155. protocol = "tcp"
  156. comment = "nginx <-> cnm_http/cm traffic (Internal use)"
  157. },
  158. {
  159. type = "ingress"
  160. from_port = "9080"
  161. to_port = "9080"
  162. protocol = "tcp"
  163. comment = "nginx <-> cnm_http/cm traffic (Internal use)"
  164. },
  165. {
  166. type = "ingress"
  167. from_port = "9081"
  168. to_port = "9081"
  169. protocol = "tcp"
  170. comment = "For CRDB management (Internal use)"
  171. },
  172. {
  173. type = "ingress"
  174. from_port = "8070"
  175. to_port = "8071"
  176. protocol = "tcp"
  177. comment = "Prometheus metrics exporter"
  178. },
  179. {
  180. type = "ingress"
  181. from_port = "9443"
  182. to_port = "9443"
  183. protocol = "tcp"
  184. comment = "REST API traffic, including cluster management and node bootstrap"
  185. },
  186. {
  187. type = "ingress"
  188. from_port = "10000"
  189. to_port = "19999"
  190. protocol = "tcp"
  191. comment = "Database traffic - if manually creating db ports pare down"
  192. },
  193. {
  194. type = "ingress"
  195. from_port = "20000"
  196. to_port = "29999"
  197. protocol = "tcp"
  198. comment = "Database shards traffic - if manually creating db ports pare down"
  199. },
  200. {
  201. type = "ingress"
  202. from_port = "53"
  203. to_port = "53"
  204. protocol = "udp"
  205. comment = "DNS Traffic"
  206. },
  207. {
  208. type = "ingress"
  209. from_port = "5353"
  210. to_port = "5353"
  211. protocol = "udp"
  212. comment = "DNS Traffic"
  213. },
  214. {
  215. type = "ingress"
  216. from_port = "-1"
  217. to_port = "-1"
  218. protocol = "icmp"
  219. comment = "Ping for connectivity checks between nodes"
  220. },
  221. {
  222. type = "egress"
  223. from_port = "-1"
  224. to_port = "-1"
  225. protocol = "icmp"
  226. comment = "Ping for connectivity checks between nodes"
  227. },
  228. {
  229. type = "egress"
  230. from_port = "0"
  231. to_port = "65535"
  232. protocol = "tcp"
  233. comment = "Let TCP out to the VPC"
  234. },
  235. {
  236. type = "egress"
  237. from_port = "0"
  238. to_port = "65535"
  239. protocol = "udp"
  240. comment = "Let UDP out to the VPC"
  241. },
  242. {
  243. type = "ingress"
  244. from_port = "8080"
  245. to_port = "8080"
  246. protocol = "tcp"
  247. comment = "Allow for host check between nodes"
  248. },
  249. ]
  250. }
  251. variable "external-rules" {
  252. description = "Security rules to allow for connectivity external to the VPC"
  253. type = list
  254. default = [
  255. {
  256. type = "ingress"
  257. from_port = "53"
  258. to_port = "53"
  259. protocol = "udp"
  260. cidr = ["0.0.0.0/0"]
  261. },
  262. {
  263. type = "egress"
  264. from_port = "0"
  265. to_port = "65535"
  266. protocol = "tcp"
  267. cidr = ["0.0.0.0/0"]
  268. },
  269. {
  270. type = "egress"
  271. from_port = "0"
  272. to_port = "65535"
  273. protocol = "udp"
  274. cidr = ["0.0.0.0/0"]
  275. }
  276. ]
  277. }