Skip to content

Commit

Permalink
feat: Add allowed_instance_types to instance_requirements (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
baolsen committed May 16, 2024
1 parent 5b2d7bf commit c2db2ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,17 @@ module "instance_requirements" {
accelerator_manufacturers = []
accelerator_names = []
accelerator_types = []
# If you specify allowed_instance_types, you can't specify excluded_instance_types
# allowed_instance_types = ["m*"]

baseline_ebs_bandwidth_mbps = {
min = 400
max = 1600
}

burstable_performance = "excluded"
cpu_manufacturers = ["amazon-web-services", "amd", "intel"]
burstable_performance = "excluded"
cpu_manufacturers = ["amazon-web-services", "amd", "intel"]
# If you specify excluded_instance_types, you can't specify allowed_instance_types
excluded_instance_types = ["t*"]
instance_generations = ["current"]
local_storage_types = ["ssd", "hdd"]
Expand Down
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,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 @@ -191,7 +192,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 Down

0 comments on commit c2db2ea

Please sign in to comment.