Skip to content

Commit bcea070

Browse files
authored
feat: Added throughput support for root and EBS disks (#1445)
1 parent 19ce95d commit bcea070

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
143143
| Name | Version |
144144
|------|---------|
145145
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
146-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.40.0 |
146+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.44.0 |
147147
| <a name="requirement_http"></a> [http](#requirement\_http) | >= 2.4.1 |
148148
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 1.11.1 |
149149
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.4 |
@@ -152,7 +152,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
152152

153153
| Name | Version |
154154
|------|---------|
155-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.40.0 |
155+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.44.0 |
156156
| <a name="provider_http"></a> [http](#provider\_http) | >= 2.4.1 |
157157
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 1.11.1 |
158158
| <a name="provider_local"></a> [local](#provider\_local) | >= 1.4 |

examples/launch_templates/main.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,22 @@ module "eks" {
7373
public_ip = true
7474
elastic_inference_accelerator = "eia2.medium"
7575
},
76+
{
77+
name = "worker-group-4"
78+
instance_type = "t3.small"
79+
asg_desired_capacity = 1
80+
public_ip = true
81+
root_volume_size = 150
82+
root_volume_type = "gp3"
83+
root_volume_throughput = 300
84+
additional_ebs_volumes = [
85+
{
86+
block_device_name = "/dev/xvdb"
87+
volume_size = 100
88+
volume_type = "gp3"
89+
throughput = 150
90+
},
91+
]
92+
},
7693
]
7794
}

local.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ locals {
9393
service_linked_role_arn = "" # Arn of custom service linked role that Auto Scaling group will use. Useful when you have encrypted EBS
9494
termination_policies = [] # A list of policies to decide how the instances in the auto scale group should be terminated.
9595
platform = local.default_platform # Platform of workers. Either "linux" or "windows".
96-
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
96+
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
9797
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.
9898
warm_pool = null # If this block is configured, add a Warm Pool to the specified Auto Scaling group.
9999

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 3.40.0"
5+
aws = ">= 3.44.0"
66
local = ">= 1.4"
77
kubernetes = ">= 1.11.1"
88
http = {

workers.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ resource "aws_launch_configuration" "workers" {
304304
"root_iops",
305305
local.workers_group_defaults["root_iops"],
306306
)
307+
throughput = lookup(
308+
var.worker_groups[count.index],
309+
"root_volume_throughput",
310+
local.workers_group_defaults["root_volume_throughput"],
311+
)
307312
delete_on_termination = true
308313
}
309314

@@ -327,6 +332,11 @@ resource "aws_launch_configuration" "workers" {
327332
"iops",
328333
local.workers_group_defaults["root_iops"],
329334
)
335+
throughput = lookup(
336+
ebs_block_device.value,
337+
"throughput",
338+
local.workers_group_defaults["root_volume_throughput"],
339+
)
330340
encrypted = lookup(
331341
ebs_block_device.value,
332342
"encrypted",

0 commit comments

Comments
 (0)