Can you guys show me how to retrieve instanceId, dns public name and type of current EC2 instance from where I’m running the code…
I’m playing with DescribeInstanceAttribute(), but it needs to supply the instanceId to the request, and I can’t find how to get the id of currently running instance.
There’s a webservice that returns machine information. Access
To retrieve the instance id
The Instance Metadata Documentation can be handy.