github.com/djenriquez/nomad-1@v0.8.1/terraform/aws/env/us-east/main.tf (about) 1 variable "name" { 2 description = "Used to name various infrastructure components" 3 default = "hashistack" 4 } 5 6 variable "region" { 7 description = "The AWS region to deploy to." 8 default = "us-east-1" 9 } 10 11 variable "ami" {} 12 13 variable "instance_type" { 14 description = "The AWS instance type to use for both clients and servers." 15 default = "t2.medium" 16 } 17 18 variable "key_name" {} 19 20 variable "server_count" { 21 description = "The number of servers to provision." 22 default = "3" 23 } 24 25 variable "client_count" { 26 description = "The number of clients to provision." 27 default = "4" 28 } 29 30 variable "retry_join" { 31 description = "Used by Consul to automatically form a cluster." 32 default = "provider=aws tag_key=ConsulAutoJoin tag_value=auto-join" 33 } 34 35 variable "nomad_binary" { 36 description = "Used to replace the machine image installed Nomad binary." 37 default = "none" 38 } 39 40 provider "aws" { 41 region = "${var.region}" 42 } 43 44 module "hashistack" { 45 source = "../../modules/hashistack" 46 47 name = "${var.name}" 48 region = "${var.region}" 49 ami = "${var.ami}" 50 instance_type = "${var.instance_type}" 51 key_name = "${var.key_name}" 52 server_count = "${var.server_count}" 53 client_count = "${var.client_count}" 54 retry_join = "${var.retry_join}" 55 nomad_binary = "${var.nomad_binary}" 56 } 57 58 output "IP_Addresses" { 59 value = <<CONFIGURATION 60 61 Client public IPs: ${join(", ", module.hashistack.client_public_ips)} 62 Server public IPs: ${join(", ", module.hashistack.server_public_ips)} 63 64 To connect, add your private key and SSH into any client or server with 65 `ssh ubuntu@PUBLIC_IP`. You can test the integrity of the cluster by running: 66 67 $ consul members 68 $ nomad server-members 69 $ nomad node-status 70 71 If you see an error message like the following when running any of the above 72 commands, it usually indicates that the configuration script has not finished 73 executing: 74 75 "Error querying servers: Get http://127.0.0.1:4646/v1/agent/members: dial tcp 76 127.0.0.1:4646: getsockopt: connection refused" 77 78 Simply wait a few seconds and rerun the command if this occurs. 79 80 The Nomad UI can be accessed at http://PUBLIC_IP:4646/ui. 81 The Consul UI can be accessed at http://PUBLIC_IP:8500/ui. 82 83 CONFIGURATION 84 }