From 54a2a28890efa6808c3d1dc531f07ee88c307b86 Mon Sep 17 00:00:00 2001 From: Tim Hartmann Date: Fri, 16 Mar 2018 14:39:08 -0400 Subject: [PATCH] Parameterizing EBS Block device This should help help address #31 --- README.md | 1 + main.tf | 2 +- variables.tf | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d360c0..d4a971e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Module Input Variables **NOTE About User Data:** The `user_data` parameter overwrites the `user_data` template used by this module, this will break some of the module features (e.g. `docker_storage_size`, `dockerhub_token`, and `dockerhub_email`). However, `additional_user_data_script` will concatenate additional data to the end of the current `user_data` script. It is recomended that you use `additional_user_data_script`. These two parameters are mutually exclusive - you can not pass both into this module and expect it to work. - `additional_user_data_script` - Additional `user_data` scripts content +- `ebs_block_device` - EBS block devices to attach to the instance. (default: /dev/xvdcz) - `region` - AWS Region - defaults to us-east-1 - `servers` - Number of ECS Servers to start in the cluster - defaults to 1 - `min_servers` - Minimum number of ECS Servers to start in the cluster - defaults to 1 diff --git a/main.tf b/main.tf index 45ab21c..99f1d01 100644 --- a/main.tf +++ b/main.tf @@ -38,7 +38,7 @@ resource "aws_launch_configuration" "ecs" { associate_public_ip_address = "${var.associate_public_ip_address}" ebs_block_device { - device_name = "/dev/xvdcz" + device_name = "${var.ebs_block_device}" volume_size = "${var.docker_storage_size}" volume_type = "gp2" delete_on_termination = true diff --git a/variables.tf b/variables.tf index b677fd8..9a12015 100644 --- a/variables.tf +++ b/variables.tf @@ -50,6 +50,11 @@ variable "enable_agents" { description = "Enable Consul Agent and Registrator tasks on each ECS Instance" } +variable "ebs_block_device" { + default = "/dev/xvdcz" + description = "EBS block devices to attach to the instance. (default: /dev/xvdcz)" +} + variable "extra_tags" { default = [] }