# Get AWS Instance Name From Instance ID....How?

**URL:** <https://community.grafana.com/t/get-aws-instance-name-from-instance-id-how/34468>\
**Category:** General\
**Created:** [July 31, 2020, 4:21am UTC](https://community.grafana.com/t/get-aws-instance-name-from-instance-id-how/34468 "2020-07-31T04:21:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![webtrendinc](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@webtrendinc](https://community.grafana.com/u/webtrendinc)\
**Post date:** [July 31, 2020, 4:21am UTC](https://community.grafana.com/t/get-aws-instance-name-from-instance-id-how/34468/1 "2020-07-31T04:21:48Z")

</div>

I have looked at the demo EC2 dashboard and the way it defines various variables. I also see that if you change the instance-id from the variable dropdown on the dashboard, other variables such as instance-type and EBS-volume change dynamically.

However, instance-name does not change dynamically because the way it is defined ( at least that is what I thought). I changed the query definition of instance-name as follows:  
`ec2_instance_attribute($region, Tags.Name, {"instance-id": ["$instanceid"]})`  
I was hoping that this would cause the instance-name to change dynamically when I changed the instance-id from the dropdown. But it does not seem to be working. I don’t think Grafana likes the above expression because it refuses to store this.

Is it possible to do it?

---

<div class="post-metadata">

**Author:** ![dborchert](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/dborchert/32/13891_2.png) [@dborchert](https://community.grafana.com/u/dborchert)\
**Post date:** [April 10, 2021, 6:15pm UTC](https://community.grafana.com/t/get-aws-instance-name-from-instance-id-how/34468/2 "2021-04-10T18:15:20Z")

</div>

@webtrendinc Did you ever figure this out? I imported an EC2 dashboard (dashboard ID 11265) but of course, it just shows instance IDs. Meaningless unless you have a translated table of instance IDs to instance names in a spreadsheet (or a grafana panel above it with fixed text of ID to name translations). I’m using Grafana 6.6.2. This [link](https://github.com/grafana/grafana/pull/8307#issuecomment-322564467) did not work for me.

![lame](https://us1.discourse-cdn.com/grafana/original/2X/0/0756ba74af0b5e0bc5cc56e283444655ee083026.png)
