Amazon AppStream 2.0
Administration Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Fleets and Stacks

With Amazon AppStream 2.0, you create fleet instances and stacks as part of the process of streaming applications. A fleet consists of streaming instances that run the image that you specify. A stack consists of an associated fleet, user access policies, and storage configurations.

Fleet Type

The fleet type determines when your instances run and how you pay for them. You can specify a fleet type when you create a fleet. You cannot change the fleet type after you create the fleet.

The following are the possible fleet types:

Always-On

Instances run all the time, even when no users are streaming applications.

On-Demand

Instances run only when users are streaming applications. Idle instances that are available for streaming are in a stopped state.

Use an Always-On fleet to provide your users with instant access to their applications. Use an On-Demand fleet to optimize your streaming charges and provide your users with access to their applications after a 1-2 minute wait. For more information, see Amazon AppStream 2.0 Pricing.

To create an On-Demand fleet, you must use a base image starting with 09-05-2017.

Session Context

You can pass parameters to your streaming application by using the create-streaming-url AppStream 2.0 API operation. If your image uses a version of the AppStream 2.0 agent that was released on or after October 30, 2018, the session context can be accessed within the image as a Windows environment variable. For information about specific environment variables, see "User and Instance Metadata for AppStream 2.0 Fleets" in Customize an AppStream 2.0 Fleet to Optimize Your Users' Application Streaming Experience .

Using Session Context to Pass Parameters to a Streaming Application

Perform the following steps to pass parameters to your streaming application. The example uses session context to launch a specific website using Firefox.

To use session context to launch a website

  1. In the left navigation pane, choose Images, Image Builder.

  2. Choose the image builder to use, verify that it is in the Running state, and choose Connect.

  3. Log in to the image builder by choosing Administrator on the Local User tab.

  4. Create a child folder of C:\. For this example, use C:\Scripts.

  5. Create a Windows batch file in the new folder. For this example, create C:\Scripts\session-context-test.bat and add a script that launches Firefox with the URL from the session context.

    Do one of the following, based on the version of the AppStream 2.0 agent that your image uses (when the AppStream 2.0 agent was released):

  6. In Image Assistant, add session-context-test.bat and change the name to Firefox.

    You do not need to add Firefox. This step requires that you add only the batch file.

  7. Create an image, fleet, and stack. For this example, use a fleet name of session-context-test-fleet and a stack name of session-context-test-stack.

  8. After the fleet is running, you can call create-streaming-url with the session-context parameter, as shown in this example.

    aws appstream create-streaming-url --stack-name session-context-test-stack \ --fleet-name session-context-test-fleet \ --user-id username –-validity 10000 \ --application-id firefox --session-context "www.amazon.com"
  9. Open the streaming URL in a browser. The batch file launches Firefox and loads http://www.amazon.com.

Using Session Context with AppStream 2.0 Agent Versions Released On or After September 5, 2017 and Before October 30, 2018

If your image uses a version of the AppStream 2.0 agent version that was released on or after September 5, 2017 and before October 30, 2018, the APPSTREAM_SESSION_CONTEXT variable is accessible only through .NET. To access the environment variable, download the SessionContextRetriever.exe file from https://dsfpe42xwhi2e.cloudfront.net/SessionContextRetriever.exe and copy this .exe file to C:\Scripts. Then, create the following script as part of completing step 5 in Using Session Context to Pass Parameters to a Streaming Application.

for /f "tokens=*" %%f in ('C:\Scripts\SessionContextRetriever.exe') do (set var=%%f) CD "C:\Program Files (x86)\Mozilla Firefox" start firefox.exe %var%

When you're done, proceed to step 6.

Using Session Context with AppStream 2.0 Agent Versions Released Before September 5, 2017

If your image uses a version of the AppStream 2.0 agent that was released before September 5, 2017, use the following script for step 5 in Using Session Context to Pass Parameters to a Streaming Application, then proceed to step 6.

CD "C:\Program Files (x86)\Mozilla Firefox" start firefox.exe %1

Parameters are passed to the streaming application.

On this page: