Last active
December 18, 2019 18:55
-
-
Save ssd532/e7f00850e5e1da8e5171748bb68aec52 to your computer and use it in GitHub Desktop.
aws-cli: ec2 instance reboot bash script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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