github.com/hspak/nomad@v0.7.2-0.20180309000617-bc4ae22a39a5/terraform/aws/env/us-east/main.tf (about)

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