2023-12-15 04:36:58 -05:00
|
|
|
# Variables common to all CSPs
|
|
|
|
|
2022-10-21 06:24:18 -04:00
|
|
|
variable "name" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Name of the Constellation cluster."
|
2023-01-23 04:37:28 -05:00
|
|
|
validation {
|
2023-07-17 11:45:41 -04:00
|
|
|
condition = length(var.name) <= 10
|
2023-12-15 04:36:58 -05:00
|
|
|
error_message = "The length of the name of the Constellation must be <= 10 characters."
|
2023-01-23 04:37:28 -05:00
|
|
|
}
|
2023-11-03 05:09:43 -04:00
|
|
|
validation {
|
|
|
|
condition = var.name == lower(var.name)
|
2023-12-15 04:36:58 -05:00
|
|
|
error_message = "The name of the Constellation must be in lowercase."
|
2023-11-03 05:09:43 -04:00
|
|
|
}
|
2022-10-21 06:24:18 -04:00
|
|
|
}
|
|
|
|
|
2023-06-23 11:19:43 -04:00
|
|
|
variable "node_groups" {
|
|
|
|
type = map(object({
|
2023-06-30 04:53:00 -04:00
|
|
|
role = string
|
|
|
|
initial_count = optional(number)
|
|
|
|
instance_type = string
|
|
|
|
disk_size = number
|
|
|
|
disk_type = string
|
|
|
|
zone = string
|
2023-06-23 11:19:43 -04: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 04:36:58 -05:00
|
|
|
variable "image_id" {
|
2022-10-21 06:24:18 -04:00
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Amazon Machine Image (AMI) ID for the cluster's nodes."
|
2022-10-21 06:24:18 -04:00
|
|
|
}
|
|
|
|
|
2023-12-15 04:36:58 -05: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 06:24:18 -04:00
|
|
|
}
|
|
|
|
|
2023-12-15 04:36:58 -05:00
|
|
|
variable "custom_endpoint" {
|
2022-10-21 06:24:18 -04:00
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
default = ""
|
|
|
|
description = "Custom endpoint to use for the Kubernetes API server. If not set, the default endpoint will be used."
|
2022-10-21 06:24:18 -04:00
|
|
|
}
|
|
|
|
|
2023-12-15 04:36:58 -05:00
|
|
|
variable "internal_load_balancer" {
|
|
|
|
type = bool
|
|
|
|
default = false
|
|
|
|
description = "Whether to use an internal load balancer for the cluster."
|
2022-10-21 06:24:18 -04:00
|
|
|
}
|
|
|
|
|
2023-12-15 04:36:58 -05:00
|
|
|
# AWS-specific variables
|
|
|
|
|
|
|
|
variable "iam_instance_profile_name_worker_nodes" {
|
2022-10-21 06:24:18 -04:00
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Name of the IAM instance profile for worker nodes."
|
2022-10-21 06:24:18 -04:00
|
|
|
}
|
|
|
|
|
2023-12-15 04:36:58 -05:00
|
|
|
variable "iam_instance_profile_name_control_plane" {
|
|
|
|
type = string
|
|
|
|
description = "Name of the IAM instance profile for control plane nodes."
|
2022-10-21 06:24:18 -04:00
|
|
|
}
|
2023-06-09 09:41:02 -04:00
|
|
|
|
2023-12-15 04:36:58 -05:00
|
|
|
variable "region" {
|
|
|
|
type = string
|
|
|
|
description = "AWS region to create the cluster in."
|
2023-06-09 09:41:02 -04:00
|
|
|
}
|
2023-07-21 10:43:51 -04:00
|
|
|
|
2023-12-15 04:36:58 -05:00
|
|
|
variable "zone" {
|
2023-07-21 10:43:51 -04:00
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "AWS availability zone name to create the cluster in."
|
2023-07-21 10:43:51 -04:00
|
|
|
}
|
2023-10-17 09:46:15 -04:00
|
|
|
|
2023-12-15 04:36:58 -05:00
|
|
|
variable "enable_snp" {
|
2023-10-17 09:46:15 -04:00
|
|
|
type = bool
|
2023-12-15 04:36:58 -05:00
|
|
|
default = true
|
|
|
|
description = "Enable AMD SEV SNP. Setting this to true sets the cpu-option AmdSevSnp to enable."
|
2023-10-17 09:46:15 -04:00
|
|
|
}
|