Help with appstream CLI to list running/paused instances in fleet.


I am familiar with the commands below but what I want to do is see a listing of all instances running in a given fleet that shows their IP, Computer name and which Image they are using. Knowing the image for each instance is important as when we replace the image in a fleet we need to see who is using new/old image for support reasons in the interim while users gradually receive the new image.

aws appstream describe-fleets

aws appstream describe-sessions --stack-name "MyStackName" --fleet-name "MyFleetName" --query "Sessions[*].[UserId,Id,State,ConnectionState,StartTime]" --output table

Also, we are only publishing desktops - is there a way to get through the image builder app on the desktop without having to publish an app. I had to publish calculator just to get to the end where an image can be created.

1 Answer
Accepted Answer

Hello, thank you for reaching out!

At this time, there is no API to query information about the underlying instances. If you run the describe-sessions API, it will only return the information from sessions that have been created. This would mean that IP's from instances that are just waiting for an incoming session would not be listed.

The closest query you can perform to answer your question is to list the Elastic Network Interfaces (ENIs) that currently exist in your account associated to your fleet. To that effect, you can run aws ec2 describe-network-interfaces --filters "Name=description,Values='AppStream 2.0 - fleet:<fleetname>'" [1]

This API will return the AttachTime timestamp in UTC format. You can then compare this time with the time when you called the UpdateFleetAPI and that will tell you which ENIs are using the new image. If you would rather get the list of the instances that are using the previous image, then you would do the query when the ENI creation date is older than the UpdateFleet API call date.

Another workaround is to schedule image replacements in the off hours, so you can stop a fleet entirely, replace the image and start them back. Using this approach (if possible) would effectively mean that all instances always use the latest image.

For your other question, Appstream originally only supported the Application view, which meant that you would need to add at least one app to the catalog to create an image. You can continue to add the Calculator or any other built in app like Notepad.


answered a year ago
  • This is a help but reveals some basic features that appstream is missing. Don't get me started on trying to white-list the appstream portal IP ranges for a given region. I don't mean the URL ones, I mean the ones that need UDP QUIC 8443. Corporations are willing to allow wide QUIC access because packets can't be inspected.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions