From bcea0708e6a53904eb30e79c80e2468cec2a374c Mon Sep 17 00:00:00 2001 From: Junaid Ali Date: Thu, 2 Sep 2021 11:28:13 +0100 Subject: [PATCH] feat: Added throughput support for root and EBS disks (#1445) --- README.md | 4 ++-- examples/launch_templates/main.tf | 17 +++++++++++++++++ local.tf | 2 +- versions.tf | 2 +- workers.tf | 10 ++++++++++ 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 621202c..9107ca7 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 3.40.0 | +| [aws](#requirement\_aws) | >= 3.44.0 | | [http](#requirement\_http) | >= 2.4.1 | | [kubernetes](#requirement\_kubernetes) | >= 1.11.1 | | [local](#requirement\_local) | >= 1.4 | @@ -152,7 +152,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.40.0 | +| [aws](#provider\_aws) | >= 3.44.0 | | [http](#provider\_http) | >= 2.4.1 | | [kubernetes](#provider\_kubernetes) | >= 1.11.1 | | [local](#provider\_local) | >= 1.4 | diff --git a/examples/launch_templates/main.tf b/examples/launch_templates/main.tf index cc1cbfb..ad71e13 100644 --- a/examples/launch_templates/main.tf +++ b/examples/launch_templates/main.tf @@ -73,5 +73,22 @@ module "eks" { public_ip = true elastic_inference_accelerator = "eia2.medium" }, + { + name = "worker-group-4" + instance_type = "t3.small" + asg_desired_capacity = 1 + public_ip = true + root_volume_size = 150 + root_volume_type = "gp3" + root_volume_throughput = 300 + additional_ebs_volumes = [ + { + block_device_name = "/dev/xvdb" + volume_size = 100 + volume_type = "gp3" + throughput = 150 + }, + ] + }, ] } diff --git a/local.tf b/local.tf index 6fb5ccd..7f4799d 100644 --- a/local.tf +++ b/local.tf @@ -93,7 +93,7 @@ locals { service_linked_role_arn = "" # Arn of custom service linked role that Auto Scaling group will use. Useful when you have encrypted EBS termination_policies = [] # A list of policies to decide how the instances in the auto scale group should be terminated. platform = local.default_platform # Platform of workers. Either "linux" or "windows". - additional_ebs_volumes = [] # A list of additional volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), volume_size, volume_type, iops, encrypted, kms_key_id (only on launch-template), delete_on_termination. Optional values are grabbed from root volume or from defaults + additional_ebs_volumes = [] # A list of additional volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), volume_size, volume_type, iops, throughput, encrypted, kms_key_id (only on launch-template), delete_on_termination. Optional values are grabbed from root volume or from defaults additional_instance_store_volumes = [] # A list of additional instance store (local disk) volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), virtual_name. warm_pool = null # If this block is configured, add a Warm Pool to the specified Auto Scaling group. diff --git a/versions.tf b/versions.tf index db42ebe..e448b56 100644 --- a/versions.tf +++ b/versions.tf @@ -2,7 +2,7 @@ terraform { required_version = ">= 0.13.1" required_providers { - aws = ">= 3.40.0" + aws = ">= 3.44.0" local = ">= 1.4" kubernetes = ">= 1.11.1" http = { diff --git a/workers.tf b/workers.tf index 31a2ffd..c73046e 100644 --- a/workers.tf +++ b/workers.tf @@ -304,6 +304,11 @@ resource "aws_launch_configuration" "workers" { "root_iops", local.workers_group_defaults["root_iops"], ) + throughput = lookup( + var.worker_groups[count.index], + "root_volume_throughput", + local.workers_group_defaults["root_volume_throughput"], + ) delete_on_termination = true } @@ -327,6 +332,11 @@ resource "aws_launch_configuration" "workers" { "iops", local.workers_group_defaults["root_iops"], ) + throughput = lookup( + ebs_block_device.value, + "throughput", + local.workers_group_defaults["root_volume_throughput"], + ) encrypted = lookup( ebs_block_device.value, "encrypted",