Am I logged into the right EC2 instance?

Photo by Kevin Horvat on Unsplash

I frequently need to verify that I’m logged into the correct AWS EC2 instance. This turned out to be a simple task since all EC2 instances expose metadata.

> curl -s http://169.254.169.254/latest/meta-data | head -10

ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
events/
hostname
iam/
identity-credentials/
instance-action
instance-id
> curl -s http://169.254.169.254/latest/meta-data/instance-id

i-095dae599ecc6310d

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Wil (₩) Moore III

Wil (₩) Moore III

Technical Writer, Software Engineer Specializing in NodeJS, TypeScript, React & React Native, SQL, DevOps, AWS, Azure, & ElasticSearch. Author of selectn.js.