Acontece que ec2-terminate-instances
faz executar um desligamento ordenado. Aqui está o que vi quando executei tail -f /var/log/messages
no sistema durante um desligamento remoto:
Apr 11 15:11:40 domU-12-31-39-09-9E-53 shutdown[22770]: shutting down for system halt
The system is going down for system halt NOW!9E-53 (Mon Apr 11 15:11:40 2011)
Apr 11 15:11:40 domU-12-31-39-09-9E-53 init: Switching to runlevel: 0
Apr 11 15:11:41 domU-12-31-39-09-9E-53 avahi-daemon[988]: Got SIGTERM, quitting.
Apr 11 15:11:41 domU-12-31-39-09-9E-53 avahi-daemon[988]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::1031:39ff:fe09:9e53.
Apr 11 15:11:41 domU-12-31-39-09-9E-53 avahi-daemon[988]: Leaving mDNS multicast group on interface eth0.IPv4 with address 10.210.161.157.
Connection to 50.17.174.93 closed by remote host.
Connection to 50.17.174.93 closed.
Portanto, não há necessidade de fazer nada especial. A instância será encerrada de forma ordenada e desaparecerá quando terminar.