|
|
@ -38,9 +38,14 @@ variable "custom_names" {
|
|
|
|
description = "A map of custom display names for instance type IDs."
|
|
|
|
description = "A map of custom display names for instance type IDs."
|
|
|
|
type = map(string)
|
|
|
|
type = map(string)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "custom_descriptions" {
|
|
|
|
|
|
|
|
default = {}
|
|
|
|
|
|
|
|
description = "A map of custom descriptions for instance type IDs."
|
|
|
|
|
|
|
|
type = map(string)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
variable "type_category" {
|
|
|
|
variable "type_category" {
|
|
|
|
default = ["standard"]
|
|
|
|
default = ["standard", "gpu"]
|
|
|
|
description = "A list of instance type categories the user is allowed to choose. One of [\"standard\", \"cpu\", \"memory\", \"storage\", \"gpu\"]"
|
|
|
|
description = "A list of instance type categories the user is allowed to choose. One of [\"standard\", \"cpu\", \"memory\", \"storage\", \"gpu\"]"
|
|
|
|
type = list(string)
|
|
|
|
type = list(string)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -57,155 +62,192 @@ locals {
|
|
|
|
standard_instances = [
|
|
|
|
standard_instances = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.micro",
|
|
|
|
value = "standard.micro",
|
|
|
|
name = "Standard Micro | 512 MB RAM, 1 Core, 10 - 200 GB Disk"
|
|
|
|
name = "Standard Micro",
|
|
|
|
|
|
|
|
description = "512 MB RAM, 1 Core, 10 - 200 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.tiny",
|
|
|
|
value = "standard.tiny",
|
|
|
|
name = "Standard Tiny | 1 GB RAM, 1 Core, 10 - 400 GB Disk"
|
|
|
|
name = "Standard Tiny",
|
|
|
|
|
|
|
|
description = "1 GB RAM, 1 Core, 10 - 400 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.small",
|
|
|
|
value = "standard.small",
|
|
|
|
name = "Standard Small | 2 GB RAM, 2 Cores, 10 - 400 GB Disk"
|
|
|
|
name = "Standard Small",
|
|
|
|
|
|
|
|
description = "2 GB RAM, 2 Cores, 10 - 400 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.medium",
|
|
|
|
value = "standard.medium",
|
|
|
|
name = "Standard Medium | 4 GB RAM, 2 Cores, 10 - 400 GB Disk"
|
|
|
|
name = "Standard Medium",
|
|
|
|
|
|
|
|
description = "4 GB RAM, 2 Cores, 10 - 400 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.large",
|
|
|
|
value = "standard.large",
|
|
|
|
name = "Standard Large | 8 GB RAM, 4 Cores, 10 - 400 GB Disk"
|
|
|
|
name = "Standard Large",
|
|
|
|
|
|
|
|
description = "8 GB RAM, 4 Cores, 10 - 400 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.extra",
|
|
|
|
value = "standard.extra",
|
|
|
|
name = "Standard Extra-Large | 16 GB RAM, 4 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "Standard Extra",
|
|
|
|
|
|
|
|
description = "rge",
|
|
|
|
|
|
|
|
description = "16 GB RAM, 4 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.huge",
|
|
|
|
value = "standard.huge",
|
|
|
|
name = "Standard Huge | 32 GB RAM, 8 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "Standard Huge",
|
|
|
|
|
|
|
|
description = "32 GB RAM, 8 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.mega",
|
|
|
|
value = "standard.mega",
|
|
|
|
name = "Standard Mega | 64 GB RAM, 12 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "Standard Mega",
|
|
|
|
|
|
|
|
description = "64 GB RAM, 12 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.titan",
|
|
|
|
value = "standard.titan",
|
|
|
|
name = "Standard Titan | 128 GB RAM, 16 Cores, 10 - 1.6 TB Disk"
|
|
|
|
name = "Standard Titan",
|
|
|
|
|
|
|
|
description = "128 GB RAM, 16 Cores, 10 - 1.6 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.jumbo",
|
|
|
|
value = "standard.jumbo",
|
|
|
|
name = "Standard Jumbo | 256 GB RAM, 24 Cores, 10 - 1.6 TB Disk"
|
|
|
|
name = "Standard Jumbo",
|
|
|
|
|
|
|
|
description = "256 GB RAM, 24 Cores, 10 - 1.6 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "standard.colossus",
|
|
|
|
value = "standard.colossus",
|
|
|
|
name = "Standard Colossus | 320 GB RAM, 40 Cores, 10 - 1.6 TB Disk"
|
|
|
|
name = "Standard Colossus",
|
|
|
|
|
|
|
|
description = "320 GB RAM, 40 Cores, 10 - 1.6 TB Disk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
cpu_instances = [
|
|
|
|
cpu_instances = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "cpu.extra",
|
|
|
|
value = "cpu.extra",
|
|
|
|
name = "CPU Extra-Large | 16 GB RAM, 8 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "CPU Extra-Large",
|
|
|
|
|
|
|
|
description = "16 GB RAM, 8 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "cpu.huge",
|
|
|
|
value = "cpu.huge",
|
|
|
|
name = "CPU Huge | 32 GB RAM, 16 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "CPU Huge",
|
|
|
|
|
|
|
|
description = "32 GB RAM, 16 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "cpu.mega",
|
|
|
|
value = "cpu.mega",
|
|
|
|
name = "CPU Mega | 64 GB RAM, 32 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "CPU Mega",
|
|
|
|
|
|
|
|
description = "64 GB RAM, 32 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "cpu.titan",
|
|
|
|
value = "cpu.titan",
|
|
|
|
name = "CPU Titan | 128 GB RAM, 40 Cores, 0.1 - 1.6 TB Disk"
|
|
|
|
name = "CPU Titan",
|
|
|
|
|
|
|
|
description = "128 GB RAM, 40 Cores, 0.1 - 1.6 TB Disk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
memory_instances = [
|
|
|
|
memory_instances = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "memory.extra",
|
|
|
|
value = "memory.extra",
|
|
|
|
name = "Memory Extra-Large | 16 GB RAM, 2 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "Memory Extra-Large",
|
|
|
|
|
|
|
|
description = "16 GB RAM, 2 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "memory.huge",
|
|
|
|
value = "memory.huge",
|
|
|
|
name = "Memory Huge | 32 GB RAM, 4 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "Memory Huge",
|
|
|
|
|
|
|
|
description = "32 GB RAM, 4 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "memory.mega",
|
|
|
|
value = "memory.mega",
|
|
|
|
name = "Memory Mega | 64 GB RAM, 8 Cores, 10 - 800 GB Disk"
|
|
|
|
name = "Memory Mega",
|
|
|
|
|
|
|
|
description = "64 GB RAM, 8 Cores, 10 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "memory.titan",
|
|
|
|
value = "memory.titan",
|
|
|
|
name = "Memory Titan | 128 GB RAM, 12 Cores, 0.1 - 1.6 TB Disk"
|
|
|
|
name = "Memory Titan",
|
|
|
|
|
|
|
|
description = "128 GB RAM, 12 Cores, 0.1 - 1.6 TB Disk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
storage_instances = [
|
|
|
|
storage_instances = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "storage.extra",
|
|
|
|
value = "storage.extra",
|
|
|
|
name = "Storage Extra-Large | 16 GB RAM, 4 Cores, 1 - 2 TB Disk"
|
|
|
|
name = "Storage Extra-Large",
|
|
|
|
|
|
|
|
description = "16 GB RAM, 4 Cores, 1 - 2 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "storage.huge",
|
|
|
|
value = "storage.huge",
|
|
|
|
name = "Storage Huge | 32 GB RAM, 8 Cores, 2 - 3 TB Disk"
|
|
|
|
name = "Storage Huge",
|
|
|
|
|
|
|
|
description = "32 GB RAM, 8 Cores, 2 - 3 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "storage.mega",
|
|
|
|
value = "storage.mega",
|
|
|
|
name = "Storage Mega | 64 GB RAM, 12 Cores, 3 - 5 TB Disk"
|
|
|
|
name = "Storage Mega",
|
|
|
|
|
|
|
|
description = "64 GB RAM, 12 Cores, 3 - 5 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "storage.titan",
|
|
|
|
value = "storage.titan",
|
|
|
|
name = "Storage Titan | 128 GB RAM, 16 Cores, 5 - 10 TB Disk"
|
|
|
|
name = "Storage Titan",
|
|
|
|
|
|
|
|
description = "128 GB RAM, 16 Cores, 5 - 10 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "storage.jumbo",
|
|
|
|
value = "storage.jumbo",
|
|
|
|
name = "Storage Jumbo | 225 GB RAM, 24 Cores, 10 - 15 TB Disk"
|
|
|
|
name = "Storage Jumbo",
|
|
|
|
|
|
|
|
description = "225 GB RAM, 24 Cores, 10 - 15 TB Disk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
gpu_instances = [
|
|
|
|
gpu_instances = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu.small",
|
|
|
|
value = "gpu.small",
|
|
|
|
name = "GPU1 Small | 56 GB RAM, 12 Cores, 1 GPU, 100 - 800 GB Disk"
|
|
|
|
name = "GPU1 Small",
|
|
|
|
|
|
|
|
description = "56 GB RAM, 12 Cores, 1 GPU, 100 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu.medium",
|
|
|
|
value = "gpu.medium",
|
|
|
|
name = "GPU1 Medium | 90 GB RAM, 16 Cores, 2 GPU, 0.1 - 1.2 TB Disk"
|
|
|
|
name = "GPU1 Medium",
|
|
|
|
|
|
|
|
description = "90 GB RAM, 16 Cores, 2 GPU, 0.1 - 1.2 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu.large",
|
|
|
|
value = "gpu.large",
|
|
|
|
name = "GPU1 Large | 120 GB RAM, 24 Cores, 3 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
name = "GPU1 Large",
|
|
|
|
|
|
|
|
description = "120 GB RAM, 24 Cores, 3 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu.huge",
|
|
|
|
value = "gpu.huge",
|
|
|
|
name = "GPU1 Huge | 225 GB RAM, 48 Cores, 4 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
name = "GPU1 Huge",
|
|
|
|
|
|
|
|
description = "225 GB RAM, 48 Cores, 4 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu2.small",
|
|
|
|
value = "gpu2.small",
|
|
|
|
name = "GPU2 Small | 56 GB RAM, 12 Cores, 1 GPU, 100 - 800 GB Disk"
|
|
|
|
name = "GPU2 Small",
|
|
|
|
|
|
|
|
description = "56 GB RAM, 12 Cores, 1 GPU, 100 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu2.medium",
|
|
|
|
value = "gpu2.medium",
|
|
|
|
name = "GPU2 Medium | 90 GB RAM, 16 Cores, 2 GPU, 0.1 - 1.2 TB Disk"
|
|
|
|
name = "GPU2 Medium",
|
|
|
|
|
|
|
|
description = "90 GB RAM, 16 Cores, 2 GPU, 0.1 - 1.2 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu2.large",
|
|
|
|
value = "gpu2.large",
|
|
|
|
name = "GPU2 Large | 120 GB RAM, 24 Cores, 3 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
name = "GPU2 Large",
|
|
|
|
|
|
|
|
description = "120 GB RAM, 24 Cores, 3 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu2.huge",
|
|
|
|
value = "gpu2.huge",
|
|
|
|
name = "GPU2 Huge | 225 GB RAM, 48 Cores, 4 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
name = "GPU2 Huge",
|
|
|
|
|
|
|
|
description = "225 GB RAM, 48 Cores, 4 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu3.small",
|
|
|
|
value = "gpu3.small",
|
|
|
|
name = "GPU3 Small | 56 GB RAM, 12 Cores, 1 GPU, 100 - 800 GB Disk"
|
|
|
|
name = "GPU3 Small",
|
|
|
|
|
|
|
|
description = "56 GB RAM, 12 Cores, 1 GPU, 100 - 800 GB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu3.medium",
|
|
|
|
value = "gpu3.medium",
|
|
|
|
name = "GPU3 Medium | 120 GB RAM, 24 Cores, 2 GPU, 0.1 - 1.2 TB Disk"
|
|
|
|
name = "GPU3 Medium",
|
|
|
|
|
|
|
|
description = "120 GB RAM, 24 Cores, 2 GPU, 0.1 - 1.2 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu3.large",
|
|
|
|
value = "gpu3.large",
|
|
|
|
name = "GPU3 Large | 224 GB RAM, 48 Cores, 4 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
name = "GPU3 Large",
|
|
|
|
|
|
|
|
description = "224 GB RAM, 48 Cores, 4 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value = "gpu3.huge",
|
|
|
|
value = "gpu3.huge",
|
|
|
|
name = "GPU3 Huge | 448 GB RAM, 96 Cores, 8 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
name = "GPU3 Huge",
|
|
|
|
|
|
|
|
description = "448 GB RAM, 96 Cores, 8 GPU, 0.1 - 1.6 TB Disk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -217,15 +259,16 @@ data "coder_parameter" "instance_type" {
|
|
|
|
default = var.default == "" ? null : var.default
|
|
|
|
default = var.default == "" ? null : var.default
|
|
|
|
mutable = var.mutable
|
|
|
|
mutable = var.mutable
|
|
|
|
dynamic "option" {
|
|
|
|
dynamic "option" {
|
|
|
|
for_each = { for k, v in concat(
|
|
|
|
for_each = [for k, v in concat(
|
|
|
|
contains(var.type_category, "standard") ? local.standard_instances : [],
|
|
|
|
contains(var.type_category, "standard") ? local.standard_instances : [],
|
|
|
|
contains(var.type_category, "cpu") ? local.cpu_instances : [],
|
|
|
|
contains(var.type_category, "cpu") ? local.cpu_instances : [],
|
|
|
|
contains(var.type_category, "memory") ? local.memory_instances : [],
|
|
|
|
contains(var.type_category, "memory") ? local.memory_instances : [],
|
|
|
|
contains(var.type_category, "storage") ? local.storage_instances : [],
|
|
|
|
contains(var.type_category, "storage") ? local.storage_instances : [],
|
|
|
|
contains(var.type_category, "gpu") ? local.gpu_instances : []
|
|
|
|
contains(var.type_category, "gpu") ? local.gpu_instances : []
|
|
|
|
) : k => v if !(contains(var.exclude, v.value)) }
|
|
|
|
) : v if !(contains(var.exclude, v.value)) ]
|
|
|
|
content {
|
|
|
|
content {
|
|
|
|
name = try(var.custom_names[option.value.value], option.value.name)
|
|
|
|
name = try(var.custom_names[option.value.value], option.value.name)
|
|
|
|
|
|
|
|
description = try(var.custom_names[option.value.value], option.value.description)
|
|
|
|
value = option.value.value
|
|
|
|
value = option.value.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|