terraform-aws-modules / terraform-aws-eks

Terraform module to create Amazon Elastic Kubernetes (EKS) resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/eks/aws
Apache License 2.0
4.47k stars 4.08k forks source link

deploying worker nodes on private subnets #413

Closed luisamador closed 5 years ago

luisamador commented 5 years ago

I have issues

I'm submitting a...

What is the current behavior?

I'm trying to get my EKS worker nodes deployed only on private subnets.

workers_group_defaults {
    subnets = ["${data.terraform_remote_state.common.private_subnets}"] #Launch Worker nodes on private subnets only.
  }

after running terraform plan I get this error message:

Error: Error refreshing state: 1 error(s) occurred:

* module.eks.data.template_file.userdata: 1 error(s) occurred:

* module.eks.data.template_file.userdata: At column 86, line 1: map "local.workers_group_defaults" does not have homogenous types. found TypeString and then TypeList in:

${lookup(var.worker_groups[count.index], "pre_userdata", local.workers_group_defaults["pre_userdata"])}

If this is a bug, how to reproduce? Please include a code sample if relevant.

Define the worker_group_defaults within your EKS module and pass in a list of private subnets.

workers_group_defaults {
    subnets = ["${data.terraform_remote_state.common.private_subnets}"] #Launch Worker nodes on private subnets only.
  }

What's the expected behavior?

The EKS worker nodes get deployed on the specified private subnets.

Environment details

Any other relevant info

btsuhako commented 5 years ago

What's the output type of data.terraform_remote_state.common.private_subnets?

The subnets variable accepts a list of strings (https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/variables.tf#L75), so if your output is already a list, might try the following:

workers_group_defaults {
    subnets = "${data.terraform_remote_state.common.private_subnets}" #Launch Worker nodes on private subnets only.
  }
github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.