How to check whether my user data passing to EC2 instance is working

amazon-ec2, amazon-web-services, user-data

Solution

You can verify using the following steps:

- SSH on launch EC2 instance.

- Check the log of your user data script in:

- `/var/log/cloud-init.log` and

- `/var/log/cloud-init-output.log`

You can see all logs of your user data script, and it will also create the `/etc/cloud` folder.

Problem

While creating a new AWS EC2 instance using the EC2 command line API, I passed some user data to the new instance. How can I know whether that user data executed or not?

Original source