Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Created September 23, 2016 01:05
Show Gist options
  • Save tkuchiki/07ed78dd9472f1c1919bd5531b344357 to your computer and use it in GitHub Desktop.
Save tkuchiki/07ed78dd9472f1c1919bd5531b344357 to your computer and use it in GitHub Desktop.
cron で ec2 止める

IAM Role でも aws configure しないと動かないので注意

$ cat /etc/cron.d/stop-instance
30 18 * * * root aws ec2 stop-instances --instance-ids $(curl -s http://169.254.169.254/latest/meta-data/instance-id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment