Skip to content

Commit

Permalink
feat: Add support for allowed_instance_type (#2552)
Browse files Browse the repository at this point in the history
  • Loading branch information
petros-d authored Apr 12, 2023
1 parent 273c48a commit 54417d2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/self-managed-node-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ module "self_managed_node_group" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.47 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.57 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.47 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.57 |

## Modules

Expand Down
16 changes: 13 additions & 3 deletions modules/self-managed-node-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ resource "aws_launch_template" "this" {
}
}

accelerator_types = try(instance_requirements.value.accelerator_types, [])
bare_metal = try(instance_requirements.value.bare_metal, null)
accelerator_types = try(instance_requirements.value.accelerator_types, [])
allowed_instance_types = try(instance_requirements.value.allowed_instance_types, null)
bare_metal = try(instance_requirements.value.bare_metal, null)

dynamic "baseline_ebs_bandwidth_mbps" {
for_each = try([instance_requirements.value.baseline_ebs_bandwidth_mbps], [])
Expand All @@ -211,7 +212,7 @@ resource "aws_launch_template" "this" {

burstable_performance = try(instance_requirements.value.burstable_performance, null)
cpu_manufacturers = try(instance_requirements.value.cpu_manufacturers, [])
excluded_instance_types = try(instance_requirements.value.excluded_instance_types, [])
excluded_instance_types = try(instance_requirements.value.excluded_instance_types, null)
instance_generations = try(instance_requirements.value.instance_generations, [])
local_storage = try(instance_requirements.value.local_storage, null)
local_storage_types = try(instance_requirements.value.local_storage_types, [])
Expand All @@ -234,6 +235,15 @@ resource "aws_launch_template" "this" {
}
}

dynamic "network_bandwidth_gbps" {
for_each = try([instance_requirements.value.network_bandwidth_gbps], [])

content {
max = try(network_bandwidth_gbps.value.max, null)
min = try(network_bandwidth_gbps.value.min, null)
}
}

dynamic "network_interface_count" {
for_each = try([instance_requirements.value.network_interface_count], [])

Expand Down
2 changes: 1 addition & 1 deletion modules/self-managed-node-group/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.47"
version = ">= 4.57"
}
}
}

0 comments on commit 54417d2

Please sign in to comment.