Skip to content

Instantly share code, notes, and snippets.

@saxenap
Last active April 21, 2018 19:01
Show Gist options
  • Save saxenap/c26d0d4e6ced98d8a162a7b967a16ada to your computer and use it in GitHub Desktop.
Save saxenap/c26d0d4e6ced98d8a162a7b967a16ada to your computer and use it in GitHub Desktop.
#!/bin/bash
yum update -y
yum install -y gcc gcc-c++ make
#!/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