Have you ever tried to extract all metadata from your EC2 instance, Windows or Linux? You likely have, as I don’t see another reason for Google to bring you to this post… right?
And I can feel that getting the metadata isn’t really working out for you 🙂
Worry not, for here’s the solution. As usual, in the form of another script that was envisioned as ten lines of code but unnecessarily grew 5 times as much.