How to base64 encode and upload userdata for EC2 Launch Template

Rafal Lukawiecki raf at rafal.net
Mon Mar 11 09:42:32 UTC 2019


Hello Everyone, Hello Colin,

I hope someone can explain, as I have been lost in this for over a week. I would like to pass a small (4-5kB) tarball of files for the built-in cloud init script of the official FreeBSD 12.0 EC2 AMI to get untarred and processed (>, >>, or #!) upon instance launch. I have successfully done it for over 2 years using Launch Configurations but I cannot make it work using the new Launch Templates.

No matter if base64 and upload via the console, or base64 and use aws cli, or create an LC and convert to an LT, it only works with LC.

So far, I can see that depending which route I use to upload the file, when I download it back from the finished template/configuration there seem to be 3 different userdata lengths, even though I always pass the same input. It suggests to me that some other processing of that input happens, and I am lost where to hunt for it.

Have any of you nailed it down? What steps do you take to prepare it?

Many thanks and regards from Ireland,
Rafal Lukawiecki


More information about the freebsd-cloud mailing list