Created
April 21, 2018 04:17
-
-
Save saxenap/63d2fc992460065205fccb54faa69dbf to your computer and use it in GitHub Desktop.
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 | |
# requires the correct region set via the cli `aws configure` or in ~/.aws/config | |
die() { status=$1; shift; echo "FATAL: $*"; exit $status; } | |
EC2_INSTANCE_ID="`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id || die \"wget in$ | |
echo $EC2_INSTANCE_ID | |
aws ec2 terminate-instances --instance-id $EC2_INSTANCE_ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment