Skip to content

Instantly share code, notes, and snippets.

@ssd532
Last active December 18, 2019 18:55
Show Gist options
  • Save ssd532/e7f00850e5e1da8e5171748bb68aec52 to your computer and use it in GitHub Desktop.
Save ssd532/e7f00850e5e1da8e5171748bb68aec52 to your computer and use it in GitHub Desktop.
aws-cli: ec2 instance reboot bash script
#!/bin/bash
instanceId="i-something"
aws ec2 stop-instances --instance-ids $instanceId;
aws ec2 wait instance-stopped --instance-ids $instanceId;
aws ec2 start-instances --instance-ids $instanceId;
aws ec2 wait instance-running --instance-ids $instanceId;
echo "machine running"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment