From 29e9909c74a01baf35a431aac21f48f7c69051d9 Mon Sep 17 00:00:00 2001 From: Benjamin Yu Date: Sat, 14 Mar 2015 11:00:22 -0700 Subject: [PATCH] Add Terraform Variable for AWS instance type Details: * Adds an input variable to the consul terraform template module to allow a user of the module to specify a different AWS instance type to launch. * The default is still "m1.small". * The module input variable is named "instance_type". --- terraform/aws/consul.tf | 2 +- terraform/aws/variables.tf | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/terraform/aws/consul.tf b/terraform/aws/consul.tf index 977f00acc..f5e6fc91c 100644 --- a/terraform/aws/consul.tf +++ b/terraform/aws/consul.tf @@ -1,6 +1,6 @@ resource "aws_instance" "server" { ami = "${lookup(var.ami, var.region)}" - instance_type = "m1.small" + instance_type = "${var.instance_type}" key_name = "${var.key_name}" count = "${var.servers}" security_groups = ["${aws_security_group.consul.name}"] diff --git a/terraform/aws/variables.tf b/terraform/aws/variables.tf index a065dbcee..35d16d7ad 100644 --- a/terraform/aws/variables.tf +++ b/terraform/aws/variables.tf @@ -22,3 +22,8 @@ variable "servers" { default = "3" description = "The number of Consul servers to launch." } + +variable "instance_type" { + default = "m1.small" + description = "The instance type to launch." +} \ No newline at end of file