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
You can verify using following steps
/var/log/cloud-init.log
/var/log/cloud-init-output.log
You can see all log's of your user data script and it will also create /etc/cloud folder.
/etc/cloud