variables.tf 6.2 KB

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