Invoke a script on EC2 termination
问题 I have to take certain actions during AWS autoscaling scale-in event.The ec2 instance should be able to save some logs and reports to S3 bucket. This can take anywhere between 5 to 15 mins. I already have a script that gets called on termination: ln -s /etc/ec2-termination /etc/rc0.d/S01ec2-termination However the script ends abruptly within 5 mins. I am looking at leveraging AWS LifeCycle hooks to extend the EC2 lifetime. The documentation is not clear on invoking a script in a way similar