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.…