-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
pre/post_bootstrap_user_data doesn't work anymore with AL2023 #3186
Comments
I can confirm this with module version 2.26, but also just from diving into the module code. The userdata for AL2023 completely ignores any values in the Instead, completely new variables with new expected syntax were introduced: Is the intent to stop supporting the userdata vars in this module? Or was it an oversight to leave out those variables from the AL2023 template file? |
Al2023 uses a different form of user data than AL2 - terraform-aws-eks/tests/user-data/main.tf Lines 108 to 210 in 97a08c8
|
@bryantbiggs Yes, and Windows also has a different form of user data than AL2, but they use the same module variables to build the templates. Are the concepts all that different between AL2 and AL2023? AL2023 seems to work the same way that AL2 works when specifying an AMI in the launch template. The only difference is an additional section for a I think this is just a matter of broken docs and expectations, not broken code. The logic for shimming a userdata script into a multipart MIME was already in this module, and it used the same userdata variables employed in other scenarios. So despite the fact that the new variables work well and allow flexibility in building a custom multipart MIME message, it is a bit unexpected to have new variables, especially given that the userdata readme still suggests using the older ones. I'm happy to make some readme update suggestions, though I'm not sure I quite understand the conditionals in the userdata module, and I've probably misunderstood something in the new AL2023 format anyway. If I've just misunderstood, then sorry. In any case, thanks for the time spent on this. |
Description
I switched my EKSes managed node group to AMI_TYPE AL2023_x86_64_STANDARD (from AL2_x86_64 previously). Then my user_data stopped working, I can see this
Unhandled unknown content-type
injournalctl -u cloud-init.service
And comparing with AL2 worker nodes, the part-001 & co script files are absent, aka the scripts/ folder is empty
Versions
Module version [Required]: 20.24.2
Terraform version: ```Terraform v1.6.6
on linux_amd64
Reproduction Code [Required]
Steps to reproduce the behavior:
No workspace
Local cache cleared
List steps : replace AMI_TYPE value by AL2023_x86_64_STANDARD
Expected behavior
My user data to be executed, hence the ops user created, so with this ~/.ssh/config
I can
Actual behavior
I have to open the AWS console, go to EC2 instance, connect via SSM, sudo, execute my user data, and only then I can SSH in as intended behavior.
Edit
Fixed TF snippet, tried with module latest 20.26.0, not better
The text was updated successfully, but these errors were encountered: