From 8f3eb0ae9541695a5e715c41ecda0d69ab3b7b55 Mon Sep 17 00:00:00 2001 From: jtimberman Date: Thu, 23 Jun 2016 18:15:04 -0600 Subject: [PATCH] Attach an EBS volume to the monolith In the incident postmortem from 2016-06-23 it was identified that we need to attach an EBS volume. Signed-off-by: jtimberman --- terraform/builder-monolith.tf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/terraform/builder-monolith.tf b/terraform/builder-monolith.tf index d22eb2eaca..1d346bd766 100644 --- a/terraform/builder-monolith.tf +++ b/terraform/builder-monolith.tf @@ -20,6 +20,22 @@ resource "aws_instance" "monolith" { agent = "${var.connection_agent}" } + ebs_block_device { + device_name = "/dev/xvdf" + volume_size = 1500 + volume_type = "gp2" + } + + provisioner "remote-exec" { + inline = [ + "sudo mkfs.ext4 /dev/xvdf", + "sudo mount /dev/xvdf /mnt", + "echo '/dev/xvdf /hab ext4 defaults 0 0' | sudo tee -a /etc/fstab", + "sudo mkdir -p /mnt/hab", + "sudo ln -s /mnt/hab /hab" + ] + } + # JW TODO: Bake AMIs with updated habitat on them instead of bootstrapping provisioner "remote-exec" { script = "${path.module}/scripts/bootstrap.sh"