2023-12-15 10:36:58 +01:00
|
|
|
# Variables common to all CSPs
|
|
|
|
|
2022-10-21 12:24:18 +02:00
|
|
|
variable "name" {
|
|
|
|
type = string
|
2023-12-15 10:36:58 +01:00
|
|
|
description = "Name of the Constellation cluster."
|
2023-01-23 10:37:28 +01:00
|
|
|
validation {
|
2023-07-17 17:45:41 +02:00
|
|
|
condition = length(var.name) <= 10
|
2023-12-15 10:36:58 +01:00
|
|
|
error_message = "The length of the name of the Constellation must be <= 10 characters."
|
2023-01-23 10:37:28 +01:00
|
|
|
}
|
2023-11-03 10:09:43 +01:00
|
|
|
validation {
|
|
|
|
condition = var.name == lower(var.name)
|
2023-12-15 10:36:58 +01:00
|
|
|
error_message = "The name of the Constellation must be in lowercase."
|
2023-11-03 10:09:43 +01:00
|
|
|
}
|
2022-10-21 12:24:18 +02:00
|
|
|
}
|
|
|
|
|
2023-06-23 17:19:43 +02:00
|
|
|
variable "node_groups" {
|
|
|
|
type = map(object({
|
2023-06-30 10:53:00 +02:00
|
|
|
role = string
|
|
|
|
initial_count = optional(number)
|
|
|
|
instance_type = string
|
|
|
|
disk_size = number
|
|
|
|
disk_type = string
|
|
|
|
zone = string
|
2023-06-23 17:19:43 +02:00
|
|
|
}))
|
|
|
|
description = "A map of node group names to node group configurations."
|
|
|
|
validation {
|
|
|
|
condition = can([for group in var.node_groups : group.role == "control-plane" || group.role == "worker"])
|
|
|
|
error_message = "The role has to be 'control-plane' or 'worker'."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
variable "image_id" {
|
2022-10-21 12:24:18 +02:00
|
|
|
type = string
|
2023-12-15 10:36:58 +01:00
|
|
|
description = "Amazon Machine Image (AMI) ID for the cluster's nodes."
|
|
|
|
validation {
|
|
|
|
condition = length(var.image_id) > 4 && substr(var.image_id, 0, 4) == "ami-"
|
|
|
|
error_message = "The \"image_id\" value must be a valid AMI ID, starting with \"ami-\"."
|
|
|
|
}
|
2022-10-21 12:24:18 +02:00
|
|
|
}
|
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
variable "debug" {
|
|
|
|
type = bool
|
|
|
|
default = false
|
|
|
|
description = "DO NOT USE IN PRODUCTION. Enable debug mode. This opens up a debugd port that can be used to deploy a custom bootstrapper."
|
2022-10-21 12:24:18 +02:00
|
|
|
}
|
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
variable "custom_endpoint" {
|
2022-10-21 12:24:18 +02:00
|
|
|
type = string
|
2023-12-15 10:36:58 +01:00
|
|
|
default = ""
|
|
|
|
description = "Custom endpoint to use for the Kubernetes API server. If not set, the default endpoint will be used."
|
2022-10-21 12:24:18 +02:00
|
|
|
}
|
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
variable "internal_load_balancer" {
|
|
|
|
type = bool
|
|
|
|
default = false
|
|
|
|
description = "Whether to use an internal load balancer for the cluster."
|
2022-10-21 12:24:18 +02:00
|
|
|
}
|
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
# AWS-specific variables
|
|
|
|
|
|
|
|
variable "iam_instance_profile_name_worker_nodes" {
|
2022-10-21 12:24:18 +02:00
|
|
|
type = string
|
2023-12-15 10:36:58 +01:00
|
|
|
description = "Name of the IAM instance profile for worker nodes."
|
2022-10-21 12:24:18 +02:00
|
|
|
}
|
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
variable "iam_instance_profile_name_control_plane" {
|
|
|
|
type = string
|
|
|
|
description = "Name of the IAM instance profile for control plane nodes."
|
2022-10-21 12:24:18 +02:00
|
|
|
}
|
2023-06-09 15:41:02 +02:00
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
variable "region" {
|
|
|
|
type = string
|
|
|
|
description = "AWS region to create the cluster in."
|
2023-06-09 15:41:02 +02:00
|
|
|
}
|
2023-07-21 16:43:51 +02:00
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
variable "zone" {
|
2023-07-21 16:43:51 +02:00
|
|
|
type = string
|
2023-12-15 10:36:58 +01:00
|
|
|
description = "AWS availability zone name to create the cluster in."
|
2023-07-21 16:43:51 +02:00
|
|
|
}
|
2023-10-17 15:46:15 +02:00
|
|
|
|
2023-12-15 10:36:58 +01:00
|
|
|
variable "enable_snp" {
|
2023-10-17 15:46:15 +02:00
|
|
|
type = bool
|
2023-12-15 10:36:58 +01:00
|
|
|
default = true
|
|
|
|
description = "Enable AMD SEV SNP. Setting this to true sets the cpu-option AmdSevSnp to enable."
|
2023-10-17 15:46:15 +02:00
|
|
|
}
|