2017-05-15 18:56:41 +00:00
|
|
|
variable "region" {
|
|
|
|
description = "The AWS region to deploy to."
|
2017-06-25 18:10:14 +00:00
|
|
|
default = "us-east-1"
|
2017-05-15 18:56:41 +00:00
|
|
|
}
|
|
|
|
|
2017-06-25 18:10:14 +00:00
|
|
|
variable "ami" {}
|
2017-05-15 18:56:41 +00:00
|
|
|
|
|
|
|
variable "instance_type" {
|
|
|
|
description = "The AWS instance type to use for both clients and servers."
|
2017-06-25 18:10:14 +00:00
|
|
|
default = "t2.medium"
|
2017-05-15 18:56:41 +00:00
|
|
|
}
|
|
|
|
|
2017-06-25 18:10:14 +00:00
|
|
|
variable "key_name" {}
|
2017-05-15 18:56:41 +00:00
|
|
|
|
|
|
|
variable "server_count" {
|
|
|
|
description = "The number of servers to provision."
|
2017-06-25 18:10:14 +00:00
|
|
|
default = "3"
|
2017-05-15 18:56:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "client_count" {
|
|
|
|
description = "The number of clients to provision."
|
2017-06-25 18:10:14 +00:00
|
|
|
default = "4"
|
2017-05-15 18:56:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "cluster_tag_value" {
|
|
|
|
description = "Used by Consul to automatically form a cluster."
|
|
|
|
default = "auto-join"
|
|
|
|
}
|
|
|
|
|
|
|
|
provider "aws" {
|
|
|
|
region = "${var.region}"
|
|
|
|
}
|
|
|
|
|
|
|
|
module "hashistack" {
|
|
|
|
source = "../../modules/hashistack"
|
|
|
|
|
2017-06-25 18:10:14 +00:00
|
|
|
region = "${var.region}"
|
|
|
|
ami = "${var.ami}"
|
|
|
|
instance_type = "${var.instance_type}"
|
|
|
|
key_name = "${var.key_name}"
|
|
|
|
server_count = "${var.server_count}"
|
|
|
|
client_count = "${var.client_count}"
|
|
|
|
cluster_tag_value = "${var.cluster_tag_value}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "primary_server_private_ips" {
|
|
|
|
value = "${module.hashistack.primary_server_private_ips}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "primary_server_public_ips" {
|
|
|
|
value = "${module.hashistack.primary_server_public_ips}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "client_private_ips" {
|
|
|
|
value = "${module.hashistack.client_private_ips}"
|
2017-05-15 18:56:41 +00:00
|
|
|
}
|
|
|
|
|
2017-06-25 18:10:14 +00:00
|
|
|
output "client_public_ips" {
|
|
|
|
value = "${module.hashistack.client_public_ips}"
|
|
|
|
}
|