terraform-aws-eks-node-group
terraform-aws-eks-node-group copied to clipboard
after_cluster_joining_userdata only allows one element
Describe the Bug
The validation of the variable after_cluster_joining_userdata expects the length of the array to be smaller than 2, but the definition says that it can contain commands in plural.
variable "after_cluster_joining_userdata" {
type = list(string)
default = []
description = "Additional `bash` commands to execute on each worker node after joining the EKS cluster (after executing the `bootstrap.sh` script). For more info, see https://kubedex.com/90-days-of-aws-eks-in-production"
validation {
condition = (
length(var.after_cluster_joining_userdata) < 2
)
error_message = "You may not specify more than one `after_cluster_joining_userdata`."
}
}
Expected Behavior
The variable to be a string or the validation to allow more than 1 element.
@jchanam Sorry if this is confusing, but it follows the pattern that optional data is provided in a list of zero or one items. The userdata can be a multi-line string:
after_cluster_joining_userdata = [<<-EOT
# After joining the cluster, execute a couple of commands
echo foo
echo bar
EOT
]
Closing due to no response after recommending a solution.