variables.tf 6.5 KB

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