diff --git a/ec2/instances.go b/ec2/instances.go index 891348a..85f63a0 100644 --- a/ec2/instances.go +++ b/ec2/instances.go @@ -93,8 +93,19 @@ func (e *Ec2) ListInstances(ctx context.Context, org string, per int64, next *st continue } + var instanceName *string + + for _, tag := range i.Tags { + if *tag.Key == "Name" { + instanceName = tag.Value + break + } + } + list = append(list, map[string]*string{ "id": i.InstanceId, + "name": instanceName, + "state": i.State.Name, }) } }