-
Notifications
You must be signed in to change notification settings - Fork 661
feat: Make userdata gzipped in case the user provided userdata is long #1956
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
Conversation
Amusingly, I've since modified my userdata to be less than 16kb when base64'd, but I still think this is a beneficial change. |
Agree, but still need to test. Was also thinking should we provide it configurable. With defaults set to zipped |
I have not tried this myself yet but reading the docs/issues I'm not sure this will work for a launch template. I came across this hashicorp/terraform-provider-aws#497 On an instance you have user_data and user_data_base64. The former explicitly states not to pass gzipped data to it, the latter accepts it. There is no such distinction on a launch template and no matching gzip accepting variant of user_data. |
I also thought this, as I vaguely remembered that launch templates didn't support compressed base64 (in one of my commits I even remove the gzip because I thought it wasn't supported, then I realised it worked and put it back), but it absolutely does work in my environment (eu-west-2), so it may have been a recent change to cloudinit? |
Is anybody able to attempt this in another region to see if it's consistently supported, or are we considering it unsupported (because the docs say it should be) and I should therefore close this PR? It's known working in |
I will run a test as well today. |
Just tried to test the PR, the cloud-init provide is not available for |
There is a terraform function for base64gzip that we could use. |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions. |
I provide big userdata,
aws_launch_template
bombs out because user_data is simply base64ified and not gzipped, making it larger than 16kb.This PR should fix that issue.
I'm testing on my infrastructure now so will let you know if it works :)Appears to work fine, though note I am editing out the exec descriptor stuff (#1959) in the fork I'm running on my infrastructure (Makeshift@16d4c04)