Skip to content

Instantly share code, notes, and snippets.

@katzefudder
Created March 11, 2025 10:58
Show Gist options
  • Save katzefudder/289bdb26b43601a323800d31c8612fd8 to your computer and use it in GitHub Desktop.
Save katzefudder/289bdb26b43601a323800d31c8612fd8 to your computer and use it in GitHub Desktop.
Opening up a terminal on my bastion host (assuming there's just one ec2)
#!/bin/bash
INSTANCE_ID=$(aws ec2 describe-instances --region eu-central-1 --output text --query "Reservations[].Instances[?State.Name == 'running'].InstanceId[]")
aws ssm start-session --target $INSTANCE_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment