Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2019 16:43:32 +0000
From:      Rafal Lukawiecki <raf@rafal.net>
To:        Colin Percival <cperciva@freebsd.org>, "Philip M. Gollucci" <pgollucci@p6m7g8.com>
Cc:        freebsd-cloud@freebsd.org
Subject:   Re: How to base64 encode and upload userdata for EC2 Launch Template 
Message-ID:  <8601F0A6-9099-4C7C-8889-38D789A81EFD@rafal.net>
In-Reply-To: <00238cea-75dc-57e2-a304-671a8dc5f5b5@freebsd.org>
References:  <16C73F7C-3673-44CC-B59E-DA247A0C2DF7@rafal.net> <cf173794-32c0-b898-4b23-8ecc7abb039e@freebsd.org> <A599F311-0169-44B3-99DC-9A6E9799F112@rafal.net> <00238cea-75dc-57e2-a304-671a8dc5f5b5@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Colin, Philip,

Thank you both for your suggestions. My set of scripts is a nice 5kB when compressed, but tar without any compression is 20kB, which means it does not get accepted as UserData by aws. Since I already use EFS for distribution of some config data (mainly rc.init scripts), I will simplify the configinit stage, repurpose the logic of it that processes files in a loop seeing if they are >, >> or #!, but run it against the mounted EFS, rather than from data that was passed in UserData.

Philip: my current set-up already caters for different versions of configs, as in, older but in production, current testing, and future. I like your idea of colours. :)

In end end, I will combine the best of both of your advice, for which I would like to thank you. I wish, however, that AWS LT and LC worked with encoded data correctly, and preferably, in the same way. Colin: have you managed to pass any userdata to your cloudconfig in a compressed tar format in a Launch Template? I have never succeeded with that, yet.

Regards from Ireland,
Rafal

> On 11 Mar 2019, at 19:37, Colin Percival <cperciva@freebsd.org> wrote:
> 
> Try it without the 'y' flag.  It's possible that this will produce something
> too big to pass as a user-data file; but if it's small enough this would be
> a useful indication of where the problem lies.
> 
> Colin Percival
> 
> On 3/11/19 12:24 PM, Rafal Lukawiecki wrote:
>> I have been using “tar cvyf fff ddd”, which I think is a compressed tarball using bzip. Should I use something else?
>> 
>> I have also noticed odd behaviour in the Console for LCs, but different behaviour in the Console for LCs, and yet different for CLI…
>> 
>> Thank you, Colin.
>> Rafal
>> 
>>> On 11 Mar 2019, at 19:21, Colin Percival <cperciva@freebsd.org> wrote:
>>> 
>>> On 3/11/19 2:42 AM, Rafal Lukawiecki wrote:
>>>> 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.
>>> 
>>> Is this a tarball, or a compressed tarball?
>>> 
>>> There's a longstanding bug (which I'm told is going to get fixed eventually!)
>>> in the AWS Console whereby any non-7-bit-clean user-data files get mangled
>>> and come out with each byte UTF-8 encoded.  I was only aware of this as an
>>> issue with the Console but it's entirely possible that someone at Amazon wrote
>>> the same bug in multiple places.
>>> 
>>> -- 
>>> Colin Percival
>>> Security Officer Emeritus, FreeBSD | The power to serve
>>> Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
>> 
>> 
>> 
> 
> -- 
> Colin Percival
> Security Officer Emeritus, FreeBSD | The power to serve
> Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8601F0A6-9099-4C7C-8889-38D789A81EFD>