Is there any way to run user defined script in already launched EC2 Instance? I have already tried by first calling modifyInstanceAttribute() to modify the user data and then starting the instance,but it is not working.
Please suggest.
Is there any way to run user defined script in already launched EC2 Instance? I have already tried by first calling modifyInstanceAttribute() to modify the user data and then starting the instance,but it is not working.
Please suggest.
By default, user data is run only once during instance initialization. If you want to run it all the time, during instance reboot, you should change cloudinit configuration.
Check this question: How do I make cloud-init startup scripts run every time my EC2 instance boots?