-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use templates with cluster name when passing userdata_override_base64
#67
Comments
As a workaround I'm doing staged apply via |
Looking into other issues, this looks like another instance of #37. |
@z0rc Yes, this is not really a bug, so much as a limitation. This module expects its inputs to be available during the plan phase, and Terraform does not have the output of the template available at the plan phase. I wonder if this will work around the problem for you: userdata_override_base64 = coalesce(local.bottlerocket_userdata, "Iw==") |
@Nuru proposed code didn't have any effect on the error, it's reproducible with Also this isn't about template per se, sample (but logically incorrect, but still) way to reproduce the error:
|
I've hit the same, no vars can be used basically Terraform version |
Check the following snippet (it works for me, with bottlerocket AMI):
|
@lyubomirdimov the only difference I see between your snippet and mine is I use As I'm trying to dig into this issue, it looks like it's discussed at hashicorp/terraform#26755 and at this moment of time would require refactroing this module in way where null checks won't be used for |
I can "fix" this particular issue by removing |
Okay, I give up trying to fix this and migrating away from this module. My last attempt was trying to build my own
It seems this module only reliably works when using majority of defaults to run AL2 nodes, running custom ami, userdata, launch template doesn't work and isn't actually tested. |
@z0rc Thank you for all the effort you put into this issue, and I am sorry we have not fixed it yet. As you pointed out, fixing it will require breaking changes, and we have them on the drawing board. We plan to have this module updated in the near future.
This is not fair. All of the inputs were tested and work when given static inputs. The fair statement is that this module only reliably works when its inputs are known at plan time. It was imagined that you would be hard-coding values, not supplying derived values. It was also imagined that Hashicorp would fix this general issue. In any case, the next version will be reworked so that it works with derived values as inputs. We will probably also simplify it so that it always creates a launch template instead trying to avoid it when possible. |
@z0rc This and all the related issues should now be resolved with the release of version 0.25.0 of this module. Please give it a try and report back. |
@Nuru sorry, but I won't be able to test and report on it. I already migrated away from module and migration back to module doesn't provide a value in my case. |
Describe the Bug
On order to launch node group with Bottlerocket OS I need to pass custom userdata, that templated like this:
This template used to render local variable like this:
Which passed to module as:
terraform plan
stage fails with:Expected Behavior
Terraform plan should execute just fine.
Steps to Reproduce
I was able to narrow down templating issue:
userdata_override_base64 = module.eks.eks_cluster_id
fails on plan with error from aboveuserdata_override_base64 = "fixed string"
successfully passes planEnvironment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
Modules:
cloudposse/eks-cluster/aws
0.38.0cloudposse/eks-node-group/aws
0.20.0As far as I was able to debug, terraform bubbles error to topmost constructed variable, so it isn't real cause reported. Real error is in https://github.com/cloudposse/terraform-aws-eks-node-group/blob/0.20.0/userdata.tf#L49 around
var.userdata_override_base64 == null
check.The text was updated successfully, but these errors were encountered: