Skip to content

Commit

Permalink
feat: Added throughput support for root and EBS disks (#1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
junaid-ali authored Sep 2, 2021
1 parent 19ce95d commit bcea070
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.40.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.44.0 |
| <a name="requirement_http"></a> [http](#requirement\_http) | >= 2.4.1 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 1.11.1 |
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.4 |
Expand All @@ -152,7 +152,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.40.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.44.0 |
| <a name="provider_http"></a> [http](#provider\_http) | >= 2.4.1 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 1.11.1 |
| <a name="provider_local"></a> [local](#provider\_local) | >= 1.4 |
Expand Down
17 changes: 17 additions & 0 deletions examples/launch_templates/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
]
},
]
}
2 changes: 1 addition & 1 deletion local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
10 changes: 10 additions & 0 deletions workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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",
Expand Down

0 comments on commit bcea070

Please sign in to comment.