cloudposse / terraform-aws-eks-node-group

Terraform module to provision a fully managed AWS EKS Node Group
https://cloudposse.com/accelerate
Apache License 2.0
90 stars 128 forks source link

Support multiple lines in before_cluster_joining_userdata and after_cluster_joining_userdata? #183

Closed kevincantu closed 3 months ago

kevincantu commented 3 months ago

Describe the Bug

When I specify multiple items in the before_cluster_joining_userdata list, I get an error on plan:

│ You may not specify more than one `before_cluster_joining_userdata`.

There's actually a test here which limits this list to one item!!

variable "before_cluster_joining_userdata" {
  type        = list(string)
  default     = []
  description = "Additional `bash` commands to execute on each worker node before joining the EKS cluster (before executing the `bootstrap.sh` script). For more info, see https://kubedex.com/90-days-of-aws-eks-in-production"
  validation {
    condition = (
      length(var.before_cluster_joining_userdata) < 2
    )
    error_message = "You may not specify more than one `before_cluster_joining_userdata`."
  }
}

Can we support a list, or update the documentation on this and after_cluster_joining_userdata?

Expected Behavior

The docs say:

before_cluster_joining_userdata list(string) Description: Additional bash commands to execute on each worker node before joining the EKS cluster (before executing > the bootstrap.sh script). For more info, see https://kubedex.com/90-days-of-aws-eks-in-production Default: []

Steps to Reproduce


module "nodegroups" {
  source = "git::https://github.com/cloudposse/terraform-aws-eks-node-group.git//?ref=6ccf1a9e30101540d479bbc9e185513476fff17a"
  ...
  before_cluster_joining_userdata = [
    "echo one",
    "echo two",
   ...

### Screenshots

_No response_

### Environment

_No response_

### Additional Context

_No response_