- Create an EC2 instance in a private subnet, and assign the AmazonSSMManagedInstanceCore IAM role to it
- Install the AWS CLI tools on your desktop
- Add a function to your .bash_profile like this:
function jumphost() {
JUMP_ID=$(aws ec2 describe-instances --filter "Name=tag:Name,Values=my-jumphost-name" --query "Reservations[].Instances[].InstanceId[]")
echo "Starting jumphost..."
aws ec2 start-instances --instance-ids $JUMP_ID
sleep 30
aws ssm start-session --target $JUMP_ID
}
Then just run "jumphost" from your terminal and boom, SSH'ed in via the magic of SSM.Bonus points: add a cronjob to your jumphost to shutdown every X hours in case you forget ;-)