Would be great now that we've been on TF 0.12 for a while now.
We could just add a type option to the worker group map to set whether it's LT or LC based?
And then remove workers_launch_template.tf completely?
When I started using this module (in Terraform 0.12), this was my first thought :). I would love to see this.
I think this can be done with for_each support and will probably solve https://github.com/terraform-aws-modules/terraform-aws-eks/issues/476
Hi, @max-rocket-internet, it would be great. I don't have a lot of experience with for_each but from what I understand don't you need some sort of way to say : for_each var.worker_groups where var.type = LC which from what I understand it is not possible to do.
For example if we have the following structure:
worker_groups = {
{
type = "LC"
instance_type = "m4.large"
asg_max_size = 5
tags = [{
key = "foo"
value = "bar"
propagate_at_launch = true
}
},
{
type = "LT"
instance_type = "m4.large"
asg_max_size = 5
tags = [{
key = "foo"
value = "bar"
propagate_at_launch = true
}
},
This works well for ASG, the for_each will be on var.worker_groups and then you can condition LT or LC on the ASG based on the value on type. But how do you handle the LC resources and LT resources with a for_each ?
I did a little testing:
with for example this structure:
worker_groups = [
{
type = "LC"
instance_type = "m4.large"
asg_max_size = 5
tags = [{
key = "foo"
value = "bar"
propagate_at_launch = true
}
},
{
type = "LT"
instance_type = "m4.large"
asg_max_size = 5
tags = [{
key = "foo"
value = "bar"
propagate_at_launch = true
},
{
type = "LT"
instance_type = "m4.large"
asg_max_size = 5
tags = [{
key = "foo"
value = "bar"
propagate_at_launch = true
}
]
Doing this lookup({for r in var.worker_groups: r.type => r...}, "LT")
returns:
[
{
type = "LT"
instance_type = "m4.large"
asg_max_size = 5
tags = [{
key = "foo"
value = "bar"
propagate_at_launch = true
},
{
type = "LT"
instance_type = "m4.large"
asg_max_size = 5
tags = [{
key = "foo"
value = "bar"
propagate_at_launch = true
}
]
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
/remove stale
@barryib @max-rocket-internet - I've been considering moving workers / workers_launch_templates to a sub-module like node_groups.
A question I have is: What is the benefit of supporting both Launch Config and Launch Template type worker groups? Can we do everything with Launch templates or are there limitations?
I also think that we could support usage of the node / worker group submodules directly, this would solve the issues that people face when trying to do something after the EKS control plane has been created but before the nodes or workers have been created. Specifically custom CNI configuration.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity since being marked as stale.
Most helpful comment
I did a little testing:
with for example this structure:
Doing this
lookup({for r in var.worker_groups: r.type => r...}, "LT")returns: