This project allows you to easily test a Cloud Init configuration with EC2
DataSource, change user data
and see the results right away .
It depends on Vagrant
as a dependency, so make sure to install it .
Create a virtual machine, connect to it, then configure to ONLY
use Amazon EC2
datasource .
vagrant up && vagrant ssh
sudo su
dpkg-reconfigure cloud-init
EC2 data source requires an endpoint to get metadata, and it needs to be available on boot time, so we set up a daemon to provide that requirement .
Start a daemon process that will listen on port 4567
that will act as our real UserData
source .
chmod +x /vagrant/script.sh
/vagrant/script.sh
At this point we have all necessary dependencies in order to run our cloud init, yet we've got 2 options to do it .
cloud-init init
sudo reboot
It will automatically run cloud init on boot .
You can look for output on /var/log/cloud-init-output.log
or /var/log/cloud-init.log
To change diferent user-data configs, change the file /vagrant/user_data.txt
at your heart's content .
If you have any errors while using vagrant up, Install virtual box guest .
vagrant plugin install vagrant-vbguest
The lib is available as open source under the terms of the MIT License.