Menu

How I stopped copying EC2 instance IDs (and why my CLI refuses to guess)
📰

How I stopped copying EC2 instance IDs (and why my CLI refuses to guess)

DEV Community: aws·Morgan Seznec·20 days ago
#vSZMBuL9
#devtoaws#devto#dev#shop#instance
Long article (1086 words) — no AI summary yet.
Reading 0:00
15s threshold

I work across a lot of AWS accounts. Reaching one machine used to take several steps: remember which account it lives in, find the matching profile in ~/.aws/config , check the region, look up the instance ID in the console or with aws ec2 describe-instances , and finally type:

aws ssm start-session --target i-0ee8781d10780ec32 --profile acme-prod --region eu-west-3

Enter fullscreen mode

Exit fullscreen mode

A few times a day, over fifteen accounts and three regions, that adds up. I wrote some shell functions to shorten it. They kept growing, and they became hop.

Searching every account at once

hop reads every profile in ~/.aws/config and ~/.aws/credentials and queries each one in its own region. The queries run in parallel, 16 at a time, and the result stays in a local cache for 15 minutes.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.