Create EC2 Ami using bash script with No Reboot

Some we need to automate things based on our requirements, here is a simple script you can set as a cronjob to take your ec2 ami,Normally ec2 requires a reboot while taking ami’s/images. Here we can take ami without rebooting the ec2 instance using –no-reboot flag.