While creating new AWS EC2 instance using EC2 command line API, i am passing some user data to new instance.
Now how i came to know whether that user data executed or no
Just for reference, you can check if the user data executed by taking a look at the system log from the EC2 console. Right click on your instance -
In the new interface: Monitor and Troubleshoot > Get System Log
In the old interface: Instance Settings > Get System log
This should open a modal window with the system logs