I wanted to use and quickly found that Vyatta was the solution I was searching for. After playing with it for a while in my home lab, I decided to try to create an AMI I could trust for my Virtual Private Cloud. I found this interesting thread and used it as a starting base for my experimentations.
Since cloud-init is not available on the Vyatta image, you have to handle by yourself the ssh public key which will let you log on the system with the “vyatta” user. This can be done by adding tweaking the /etc/rc.local script. We’ll also add code to load the Vyatta configuration from the instance’s user-data!
Next, set the execute bits on the script so it can be executed by the system.
Next, create the expect script to import the Vyatta configuration from user-data.
Once again, don’t forget to set the execute bits!
Next, create the expect script to import the Vyatta configuration from user-data.
And once again, don’t forget to set the execute bits!
Job’s done! You can now detach your EBS volume, snapshot it and register the AMI from the snapshot!