separate vars and outputs into their own files and update default link in nomad binary variable to 0.10.0 release (#6550)

This commit is contained in:
Omar Khawaja
2019-10-25 14:15:30 -04:00
committed by GitHub
parent a7861b7637
commit 71cac63f28
4 changed files with 94 additions and 97 deletions

View File

@@ -1,64 +1,3 @@
variable "name" {
description = "Used to name various infrastructure components"
}
variable "whitelist_ip" {
description = "IP to whitelist for the security groups (set 0.0.0.0/0 for world)"
}
variable "region" {
description = "The AWS region to deploy to."
default = "us-east-1"
}
variable "ami" {
}
variable "server_instance_type" {
description = "The AWS instance type to use for servers."
default = "t2.medium"
}
variable "client_instance_type" {
description = "The AWS instance type to use for clients."
default = "t2.medium"
}
variable "root_block_device_size" {
description = "The volume size of the root block device."
default = 16
}
variable "key_name" {
description = "Name of the SSH key used to provision EC2 instances."
}
variable "server_count" {
description = "The number of servers to provision."
default = "3"
}
variable "client_count" {
description = "The number of clients to provision."
default = "4"
}
variable "retry_join" {
description = "Used by Consul to automatically form a cluster."
type = map(string)
default = {
provider = "aws"
tag_key = "ConsulAutoJoin"
tag_value = "auto-join"
}
}
variable "nomad_binary" {
description = "Used to replace the machine image installed Nomad binary."
default = "none"
}
provider "aws" {
region = var.region
}
@@ -79,38 +18,3 @@ module "hashistack" {
root_block_device_size = var.root_block_device_size
whitelist_ip = var.whitelist_ip
}
output "IP_Addresses" {
value = <<CONFIGURATION
Client public IPs: ${join(", ", module.hashistack.client_public_ips)}
Server public IPs: ${join(", ", module.hashistack.server_public_ips)}
To connect, add your private key and SSH into any client or server with
`ssh ubuntu@PUBLIC_IP`. You can test the integrity of the cluster by running:
$ consul members
$ nomad server members
$ nomad node status
If you see an error message like the following when running any of the above
commands, it usually indicates that the configuration script has not finished
executing:
"Error querying servers: Get http://127.0.0.1:4646/v1/agent/members: dial tcp
127.0.0.1:4646: getsockopt: connection refused"
Simply wait a few seconds and rerun the command if this occurs.
The Nomad UI can be accessed at http://${module.hashistack.server_lb_ip}:4646/ui.
The Consul UI can be accessed at http://${module.hashistack.server_lb_ip}:8500/ui.
Set the following for access from the Nomad CLI:
export NOMAD_ADDR=http://${module.hashistack.server_lb_ip}:4646
CONFIGURATION
}

33
terraform/aws/env/us-east/outputs.tf vendored Normal file
View File

@@ -0,0 +1,33 @@
output "IP_Addresses" {
value = <<CONFIGURATION
Client public IPs: ${join(", ", module.hashistack.client_public_ips)}
Server public IPs: ${join(", ", module.hashistack.server_public_ips)}
To connect, add your private key and SSH into any client or server with
`ssh ubuntu@PUBLIC_IP`. You can test the integrity of the cluster by running:
$ consul members
$ nomad server members
$ nomad node status
If you see an error message like the following when running any of the above
commands, it usually indicates that the configuration script has not finished
executing:
"Error querying servers: Get http://127.0.0.1:4646/v1/agent/members: dial tcp
127.0.0.1:4646: getsockopt: connection refused"
Simply wait a few seconds and rerun the command if this occurs.
The Nomad UI can be accessed at http://${module.hashistack.server_lb_ip}:4646/ui.
The Consul UI can be accessed at http://${module.hashistack.server_lb_ip}:8500/ui.
Set the following for access from the Nomad CLI:
export NOMAD_ADDR=http://${module.hashistack.server_lb_ip}:4646
CONFIGURATION
}

View File

@@ -13,7 +13,7 @@ name = "nomad"
# `nomad_binary` (optional, null) - URL of a zip file containing a nomad
# executable with which to replace the Nomad binaries in the AMI.
# - Typically this is left commented unless necessary.
#nomad_binary = "https://releases.hashicorp.com/nomad/0.9.0/nomad_0.9.0_linux_amd64.zip"
#nomad_binary = "https://releases.hashicorp.com/nomad/0.10.0/nomad_0.10.0_linux_amd64.zip"
# `region` ("us-east-1") - sets the AWS region to build your cluster in.
#region = "us-east-1"

60
terraform/aws/env/us-east/variables.tf vendored Normal file
View File

@@ -0,0 +1,60 @@
variable "name" {
description = "Used to name various infrastructure components"
}
variable "whitelist_ip" {
description = "IP to whitelist for the security groups (set 0.0.0.0/0 for world)"
}
variable "region" {
description = "The AWS region to deploy to."
default = "us-east-1"
}
variable "ami" {
}
variable "server_instance_type" {
description = "The AWS instance type to use for servers."
default = "t2.medium"
}
variable "client_instance_type" {
description = "The AWS instance type to use for clients."
default = "t2.medium"
}
variable "root_block_device_size" {
description = "The volume size of the root block device."
default = 16
}
variable "key_name" {
description = "Name of the SSH key used to provision EC2 instances."
}
variable "server_count" {
description = "The number of servers to provision."
default = "3"
}
variable "client_count" {
description = "The number of clients to provision."
default = "4"
}
variable "retry_join" {
description = "Used by Consul to automatically form a cluster."
type = map(string)
default = {
provider = "aws"
tag_key = "ConsulAutoJoin"
tag_value = "auto-join"
}
}
variable "nomad_binary" {
description = "Used to replace the machine image installed Nomad binary."
default = "none"
}