From ed77ff16df254242bb0b6acaaec6e80f96261fc1 Mon Sep 17 00:00:00 2001 From: Andre Narciso <37899965+andrenarciso4@users.noreply.github.com> Date: Wed, 8 May 2024 13:03:54 +0100 Subject: [PATCH] add EBS volume type support (#119) --- terraform/ecs.tf | 8 ++++++++ terraform/variables.tf | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/terraform/ecs.tf b/terraform/ecs.tf index c236239..84e7df7 100644 --- a/terraform/ecs.tf +++ b/terraform/ecs.tf @@ -57,6 +57,14 @@ resource "aws_launch_template" "cluster" { key_name = var.ssh_key_name instance_initiated_shutdown_behavior = "terminate" + block_device_mappings { + device_name = "/dev/xvda" + + ebs { + volume_type = var.volume_type + } + } + iam_instance_profile { name = aws_iam_instance_profile.cluster-ec2-role.id } diff --git a/terraform/variables.tf b/terraform/variables.tf index 6b43b81..ef11f40 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -102,6 +102,11 @@ variable "instance_type" { description = "instance type" } +variable "volume_type" { + description = "volume type" + default = "gp2" +} + variable "ssh_key_name" { description = "ssh key name" }