

# Fleets and Stacks in Fleet Type in Amazon WorkSpaces Applications
<a name="managing-stacks-fleets"></a>

With Amazon WorkSpaces Applications, 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.

**Topics**
+ [Session Context](managing-stacks-fleets-session-context.md)
+ [Fleet Types](fleet-type.md)
+ [Instance Families](instance-types.md)
+ [Create a Fleet and Stack](set-up-stacks-fleets.md)
+ [Customize a Fleet](customize-fleets.md)
+ [Update a Fleet](update-fleets-new-image.md)
+ [Fleet Auto Scaling](autoscaling.md)
+ [Multi-Session Recommendations](multi-session-recs.md)

# Session Context in Amazon WorkSpaces Applications
<a name="managing-stacks-fleets-session-context"></a>

You can pass parameters to your streaming application by using either of the following methods:
+ Specify session content in the CreateStreamingURL WorkSpaces Applications API operation. For more information, see [CreateStreamingURL](https://docs.aws.amazon.com/appstream2/latest/APIReference/API_CreateStreamingURL.html).
+ Add the sts:TagSession permission to your IAM role's trust policy and specify the session context as a SAML assertion in your SAML 2.0 identity provider's authentication response. For more information, see [Step 5: Create Assertions for the SAML Authentication Response](external-identity-providers-setting-up-saml.md#external-identity-providers-create-assertions) and [Step 5: Create Assertions for the SAML Authentication Response](external-identity-providers-setting-up-saml.md#external-identity-providers-create-assertions).

If your image uses a version of the WorkSpaces Applications agent that was released on or after October 30, 2018, the session context is stored within the image as a Windows or Linux environment variable. For information about specific environment variables, see "User and Instance Metadata for WorkSpaces Applications Fleets" in [Customize an Amazon WorkSpaces Applications Fleet to Optimize Your Users' Application Streaming Experience](customize-fleets.md). 

**Note**  
The session context parameter is visible to the user in the WorkSpaces Applications streaming URL. We strongly recommend that you never put confidential or sensitive information in the session context parameter. Because it is possible for users to modify the streaming URL, we recommend performing additional validation to determine that the session context is valid for the end user. For example, you can compare the session context with other session information, such as user and instance metadata for WorkSpaces Applications fleets.   
WorkSpaces Applications does not perform validation on the session context parameter. 

## Using Session Context to Pass Parameters to a Streaming Application
<a name="managing-stacks-fleets-parameters"></a>

In the following steps, you'll use session context to start a web browser and automatically open a specific website. For instances running Windows, you'll use Firefox. For instances running Linux, you'll use Chromium.

**To use session context to launch a website**

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

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

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

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

1. 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.

   Use the following script:

   ```
   CD "C:\Program Files (x86)\Mozilla Firefox"
   Start firefox.exe %APPSTREAM_SESSION_CONTEXT%
   ```

1. 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.

1. 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**.

1. After the fleet is running, you can call [create-streaming-url](https://docs.aws.amazon.com/cli/latest/reference/appstream/create-streaming-url.html) 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"
   ```

1. Open the streaming URL in a browser. The script file launches Firefox and loads `http://www.amazon.com`.

Similarly, you can perform the following steps to pass parameters to your Linux streaming application.

**To pass parameters to your Linux streaming application**

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

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

1. Log in to the image builder by default as **ImageBuilderAdmin**.

1. Create a script file (for example, launch-chromium.sh) by running the following command:

   **sudo vim /usr/bin/launch-chromium.sh**

1. Write the script and set executable permissions, such as the following:
**Note**  
\$1\$1/bin/bash and source /etc/profile are always required in the script.

   ```
   #!/bin/bash
   source /etc/profile
   /usr/bin/chromium-browser $APPSTREAM_SESSION_CONTEXT
   ```

1. Use the Image Assistant CLI to add launch-chromium.sh:

   ```
   sudo AppStreamImageAssistant add-application \ 
   --name chromium \
   --absolute-app-path /usr/bin/launch-chromium.sh
   ```

1. 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**.

1. After the fleet is running, you can call [create-streaming-url](https://docs.aws.amazon.com/cli/latest/reference/appstream/create-streaming-url.html) 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 \
   --application-id chromium --session-context "www.amazon.com"
   ```

1. Open the streaming URL in a browser. The batch file launches Chromium and loads `http://www.amazon.com`.

# WorkSpaces Applications Fleet Types
<a name="fleet-type"></a>

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  
Streaming instances run all the time, even when no users are streaming applications and desktops. Streaming instances must be provisioned before a user is able to stream. The number of streaming instances provisioned is managed through auto scaling rules.  
When your users choose their application or desktop, they will start streaming instantly. You are charged the running instance fee for all streaming instances, even when no users are streaming.

On-Demand  
Streaming instances run only when users are streaming applications and desktops. Streaming instances not yet assigned to users are in a stopped state. Streaming instances must be provisioned before a user is able to stream. The number of streaming instances provisioned is managed through auto scaling rules.  
When your users choose their application or desktop, they will start streaming after a 1-2 minute wait. You are charged a lower stopped instance fee for streaming instances that are not yet assigned to users, and the running instance fee for streaming instances that are assigned to users.

Elastic  
The pool of streaming instances is managed by WorkSpaces Applications. When your users select their application or desktop to launch, they will start streaming after the app block has been downloaded and mounted to a streaming instance. For more information about creating app blocks for your Elastic fleets, see [App Blocks](app-blocks.md).  
You are charged the running instance fee for Elastic fleet streaming instances only for the duration of the streaming session, in seconds, with a minimum of 15 minutes.

For more information about how fleet types are charged, see [Amazon WorkSpaces Applications Pricing](https://aws.amazon.com/appstream2/pricing/).

## Always-On and On-Demand Fleets
<a name="always-demand-fleet"></a>

Always-On and On-Demand fleets represent a pool of streaming instances that you manage the capacity of using auto scaling policies. Your users use the streaming instances to stream their applications and desktops. With an Always-On fleet, your user’s application launches nearly instantly, and you pay the running instance rate per instance even when a user isn’t streaming. With an On-Demand fleet, your user’s application launches after a 1-2 minute wait as the streaming instance is started, and you pay a lower cost stopped instance fee for instances not in use, and the running instance fee for instances that are in use.

Applications for Always-On and On-Demand fleet instances are delivered through WorkSpaces Applications images that are created by image builders. You can learn more about how to create an image builder, install your applications, and create an image by reading [Images](managing-images.md).

Always-On and On-Demand fleet streaming instances must be provisioned and unassigned to an existing user before a user can stream. You can use fixed or dynamic fleet autoscaling policies to manage the number of instances in your fleet, ensuring that you have sufficient available capacity to meet your user needs while controlling costs. You can learn more about scaling your fleets by reading [Fleet Auto Scaling for Amazon WorkSpaces Applications](autoscaling.md).

## Elastic Fleets
<a name="elastic-fleet"></a>

Elastic fleets represent a pool of streaming instances that WorkSpaces Applications manages. You do not need to predict concurrency, or create and manage any auto scaling policies for your users to stream their applications and desktops. When your user requests a streaming instance, a streaming instance is assigned from the pool, and made available to them after configuration completes. 

Elastic fleets rely on applications that are stored on app blocks. When a user chooses an application from the catalog, the app block is downloaded to the instance, mounted, and then the application launches.

AWS manages the streaming instance provisioning and availability with an Elastic fleet. You need to configure the maximum concurrency you expect when creating and updating the fleet, and ensure that you have sufficient streaming instance limits to meet your user demand.

For more information about creating app blocks for your Elastic fleets, see [App Blocks](app-blocks.md).

# WorkSpaces Applications Instance Families
<a name="instance-types"></a>

Amazon WorkSpaces Applications users stream applications from stacks that you create. Each stack is associated with a fleet. When you create a fleet, the instance type that you specify determines the hardware of the host computers used for your fleet. Each instance type offers different compute, memory, and GPU capabilities. Instance types are grouped into *instance families* based on these capabilities. For hardware specifications and pricing information, see [WorkSpaces Applications Pricing](https://aws.amazon.com/appstream2/pricing/).

When you create a fleet or image builder, you must select an image that is compatible with the instance family on which you intend to run your fleet.
+ When launching a new image builder, you are presented with a list of the images in your image registry. Select the appropriate base image.
+ When launching a fleet, ensure that the private image you select was created from the appropriate base image.

The following table summarizes the available instance families and provides the base image naming format for each. Select an instance type from an instance family based on the requirements of the applications that you plan to stream on your fleet, and match the base image according to the following table.

**Note**  
If your use case involves real-time audio-video (AV) or other scenarios that require high frame rates and your display performance isn't as expected, consider scaling up to a larger instance size.  
Graphics Pro are no longer available after 10/31/2025 due to End of Life of hardware supporting Graphics Pro instance types.   
Graphics Design instances will no longer be available from AWS after 12/31/2025 due to End of Life of hardware supporting Graphics Design instance types. 


| Instance Family | Description | Base Image Name | 
| --- | --- | --- | 
| General Purpose | Basic computing resources for running web browsers and most business applications. | For stream.standard.\$1 instance types: AppStream-WinServer-*OperatingSystemVersion*-*MM-DD-YYYY* AppStream-RockyLinux8-*MM-DD-YYYY* AppStream-RHEL8-*MM-DD-YYYY*  | 
|  |  | [Import Image](import-image.md) for GeneralPurpose.\$1 instance types | 
| Compute Optimized | Optimized for compute-bound applications that benefit from high performance processors. | For stream.compute.\$1 instance types: AppStream-WinServer-*OperatingSystemVersion*-*MM-DD-YYYY* AppStream-RockyLinux8-*MM-DD-YYYY* AppStream-RHEL8-*MM-DD-YYYY* | 
|  |  | [Import Image](import-image.md) for ComputeOptimized.\$1 instance types | 
| Memory Optimized | Optimized for memory-intensive applications that process large amounts of data. If you plan to use WorkSpaces Applications z1d-based instances, you must provision them from images that were created from WorkSpaces Applications base images published on or after June 12, 2018.  | For stream.memory.\$1 instance types: AppStream-WinServer-*OperatingSystemVersion*-*MM-DD-YYYY* AppStream-RockyLinux8-*MM-DD-YYYY* AppStream-RHEL8-*MM-DD-YYYY*  | 
|  |  | [Import Image](import-image.md) for MemoryOptimized.\$1 instance types | 
| Graphics Design | Uses AMD FirePro S7150x2 Server GPUs and AMD Multiuser GPU technology to support graphics applications that use DirectX, OpenGL, or OpenCL.  | AppStream-Graphics-Design-WinServer-OperatingSystemVersion-MM-DD-YYYY  | 
| Graphics G4dn | Uses NVIDIA T4 GPUs to support graphics intensive applications. | For stream.graphics.g4dn.\$1 instance types: AppStream-Graphics-G4dn-WinServer-*OperatingSystemVersion*-*MM-DD-YYYY* AppStream-Graphics-G4dn-RockyLinux8-*MM-DD-YYYY* AppStream-Graphics-G4dn-RHEL8-*MM-DD-YYYY*  | 
|  |  | [Import Image](import-image.md) for Accelerated.g4dn.\$1 instance types | 
| Graphics G5 | Uses NVIDIA A10G GPUs to support graphics-intensive applications such as remote workstations, video rendering, and gaming, to produce high fidelity graphics in real time. | For stream.graphics.g5.\$1 instance types: AppStream-Graphics-G5-WinServer-*OperatingSystemVersion*-*MM-DD-YYYY* AppStream-Graphics-G5-RockyLinux8-*MM-DD-YYYY* AppStream-Graphics-G5-RHEL8-*MM-DD-YYYY*  | 
|  |  | [Import Image](import-image.md) for Accelerated.g5.\$1 instance types | 
| Graphics G6 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/appstream2/latest/developerguide/instance-types.html) Note: For G6f and Gr6f, use images with date 07-28-2025 or later.  | For stream.graphics.g6/gr6/g6f/gr6f.\$1 instance types: AppStream-Graphics-G6-*WinServerOperatingSystemVersion*-*MM-DD-YYYY* AppStream-Graphics-G6-RockyLinux8-*MM-DD-YYYY* AppStream-Graphics-G6-RHEL8-*MM-DD-YYYY*  | 
|  |  | [Import Image](import-image.md) for Accelerated.g6/gr6/g6f/gr6f.\$1 instance types | 
| Graphics G6e | Powered by NVIDIA L40S Tensor Core GPUs and third generation AMD EPYC processors. | [Import Image](import-image.md) for Accelerated.g6e.\$1 instance types | 
|  |  |  | 

WorkSpaces Applications instances have one 200 GB fixed-size volume, which is used for the C drive. Because WorkSpaces Applications is non-persistent, each instance's volume is immediately deleted after each user session.

For more information, see the following:
+ [WorkSpaces Applications Base Image and Managed Image Update Release Notes](base-image-version-history.md)
+ [Amazon WorkSpaces Applications Service Quotas](limits.md)
+ [WorkSpaces Applications Pricing](https://aws.amazon.com/appstream2/pricing/)

# Create an Amazon WorkSpaces Applications Fleet and Stack
<a name="set-up-stacks-fleets"></a>

To stream your applications, Amazon WorkSpaces Applications requires an environment that includes a fleet that is associated with a stack, as well as at least one application image. This tutorial describes the steps to set up a fleet and stack, and how to give users access to the stack. If you haven't already done so, we recommend that you try the procedures in [Get Started with Amazon WorkSpaces Applications: Set Up With Sample Applications](getting-started.md) first.

If you want to create an image to use, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md).

If you plan to join a fleet to an Active Directory domain, configure your Active Directory domain before completing the following steps. For more information, see [Using Active Directory with WorkSpaces Applications](active-directory.md).

**Topics**
+ [Create a Fleet in Amazon WorkSpaces Applications](set-up-stacks-fleets-create.md)
+ [Create a Stack in Amazon WorkSpaces Applications](set-up-stacks-fleets-install.md)
+ [Provide Access to Users in Amazon WorkSpaces Applications](set-up-stacks-fleets-add.md)
+ [Clean Up Resources in Amazon WorkSpaces Applications](set-up-stacks-fleets-finish.md)

# Create a Fleet in Amazon WorkSpaces Applications
<a name="set-up-stacks-fleets-create"></a>

Set up and create a fleet from which user applications are launched and streamed.

**Note**  
To create an Always-On or On-Demand fleet, you must have an image that has applications installed to create an Always-On or On-Demand fleet that your users can stream from. To create an image, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md). To create an Elastic fleet, you must have applications associated to app blocks. To create applications and app blocks for an Elastic fleet, see [Applications Manager](app-blocks-applications.md).

**To set up and create a fleet**

1. Open the WorkSpaces Applications console at [https://console.aws.amazon.com/appstream2/home](https://console.aws.amazon.com/appstream2/home).

1. Choose **Get Started** if you are new to the console, or **Fleets** from the left navigation pane. Choose **Create Fleet**.

1. For **Step 1: Select fleet type**, review the details of the fleet types, choose the type of fleet to create based on your use case, and select **Next**.
**Note**  
The fleet type determines its immediate availability and how you pay for it. For more information, see [WorkSpaces Applications Fleet Types](fleet-type.md).

1. If you chose to create an Always-On or On-Demand fleet, for **Step 2: Choose an Image**, choose an image that meets your needs and then choose **Next**.

1. If you chose to create an Elastic fleet, for **Step 2: Assign applications**, choose the applications that users can launch from this fleet.

1. For **Step 3: Configure fleet**, enter the following **details**: 
   + For **Name**, enter a unique name identifier for the fleet. Special characters aren't allowed.
   + For **Display Name**, enter a name to display for the fleet (maximum of 100 characters). Special characters aren't allowed.
   + For **Description**, enter a description for the fleet (maximum of 256 characters).
   + For **Choose instance type**, choose the instance type that meets the performance requirements of your applications. All streaming instances in your fleet launch with the instance type that you select. For more information, see [WorkSpaces Applications Instance Families](instance-types.md).
     + You can use stream.\$1 instance types for images with `type = "native"`. To use any of the following instance type you must [Import Image](import-image.md) and create an image with `type = "custom"`.
       + GeneralPurpose.\$1
       + MemoryOptimized.\$1
       + ComputeOptimized.\$1
       + Accelerated.\$1
   + Configure **storage** volumes for Always-On or On-Demand fleet instances. By default, the storage volume matches your image volume size, with a service default of 200 GB included in the hourly instance rate. You can customize your storage capacity from 200 GB up to 500 GB based on your requirements.
**Note**  
Note: Storage volume size cannot be set below the image volume size. Storage capacity can be increased up to 500 GB, with additional charges applying to any storage beyond the included 200 GB. These charges apply to fleet instances regardless of their running state (both running and stopped instances).
   + For Elastic fleets, for **Choose platform type**, choose the operating system that matches the requirements of your users’ applications.
   + For **Maximum session duration in minutes**, choose the maximum amount of time that a streaming session can remain active. If users are still connected to a streaming instance five minutes before this limit is reached, they are prompted to save any open documents before being disconnected. After this time elapses, the instance is terminated and replaced by a new instance. The maximum session duration that you can set in the WorkSpaces Applications console is 5760 minutes (96 hours). The maximum session duration that you can set using the WorkSpaces Applications API and CLI is 432000 seconds (120 hours).
   + For **Disconnect timeout in minutes**, choose the amount of time that a streaming session remains active after users disconnect. If users try to reconnect to the streaming session after a disconnection or network interruption within this time interval, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance. If you associate a stack with a fleet for which a redirect URL is specified, after users’ streaming sessions end, the users are redirected to that URL.

     If a user ends the session by choosing **End Session** or **Logout** on the WorkSpaces Applications toolbar, the disconnect timeout does not apply. Instead, the user is prompted to save any open documents, and then immediately disconnected from the streaming instance. The instance the user was using is then terminated. 
   + For **Idle disconnect timeout in minutes**, choose the amount of time that users can be idle (inactive) before they are disconnected from their streaming session and the **Disconnect timeout in minutes** time interval begins. Users are notified before they are disconnected due to inactivity. If they try to reconnect to the streaming session before the time interval specified in **Disconnect timeout in minutes** has elapsed, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance. Setting this value to 0 disables it. When this value is disabled, users are not disconnected due to inactivity.
**Note**  
Users are considered idle when they stop providing keyboard or mouse input during their streaming session. For domain-joined fleets, the countdown for the idle disconnect timeout doesn't begin until users log in with their Active Directory domain password or with a smart card. File uploads and downloads, audio in, audio out, and pixels changing do not qualify as user activity. If users continue to be idle after the time interval in **Idle disconnect timeout in minutes** elapses, they are disconnected. 
   + For Elastic fleets, for **Max concurrent sessions**, specify the maximum number of concurrent sessions this fleet should have.
**Note**  
If you get an error message that says “The maximum number of concurrent sessions for your account was exceeded," you can submit a limit increase, through the Service Quotas console at [https://console.aws.amazon.com/servicequotas/](https://console.aws.amazon.com/servicequotas/). For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*.
   + **Multiple user sessions** — Choose this option if you want to provision multiple user sessions on a single instance. By default, every unique user session is served by an instance (single-session). 
**Note**  
Multi-session is available only on Always-on and On-demand fleets powered by a Windows operating system. Multi-session is not available on Elastic fleets or the Linux operating system.  
Only base images and managed image updates released on or after May 15, 2023 support multi-session fleets. For more details, see [WorkSpaces Applications Base Image and Managed Image Update Release Notes](base-image-version-history.md).
   + **Maximum sessions per instance** — Maximum number of user sessions on an instance. You must choose this value based on your end users' application performance needs. You can also adjust the maximum sessions per instance for a fleet after it is provisioned. In that case, the existing user sessions and instances will not be impacted, but the fleet will become consistent with the new value of maximum sessions per instance. The value must be between 2 and 50. Before setting this value for your fleet, see [Multi-Session Recommendations](multi-session-recs.md).
   + For Always-On and On-Demand fleets, for **Minimum capacity**, choose a minimum number of instances (for single-session fleets) or user sessions (for multi-session fleets) for your fleet based on the minimum number of expected concurrent users. 
   + For Always-On and On-Demand fleets, for **Maximum capacity**, choose a maximum number of instances (for single-session fleets) or user sessions (for multi-session fleets) for your fleet based on the maximum number of expected concurrent users. 
**Note**  
For multi-session, you must specify the capacity based on the number of user sessions. The service will calculate the required number of instances to be launched, based on your fleet configuration and the value of maximum sessions per instance. 
   + For **Stream view**, choose the WorkSpaces Applications view that is displayed to your users during their streaming sessions. Choose **Application** to display only the windows of applications opened by users. Choose **Desktop** to display the standard desktop that is provided by the operating system. 
**Note**  
By default, WorkSpaces Applications displays only the windows of applications opened by users during their streaming sessions. To enable **Desktop **view for your users, configure your fleet to use an WorkSpaces Applications image that uses a version of the WorkSpaces Applications agent released on or after February 19, 2020.
   + For **Scaling details (Advanced)**, specify the scaling policies that WorkSpaces Applications uses to increase and decrease the capacity of your fleet. Note that the size of your fleet is limited by the minimum and maximum capacity that you specified. For more information, see [Fleet Auto Scaling for Amazon WorkSpaces Applications](autoscaling.md).
   + For **IAM role (Advanced)**, when you apply an IAM role from your account to an WorkSpaces Applications fleet instance, you can make AWS API requests from the fleet instance without manually managing AWS credentials. To apply an IAM role, do either of the following:
     + To use an existing IAM role in your AWS account, choose the role that you want to use from the **IAM role** list. The role must be accessible from the fleet instance. For more information, see [Configuring an Existing IAM Role to Use With WorkSpaces Applications Streaming Instances](configuring-existing-iam-role-to-use-with-streaming-instances.md).
     + To create a new IAM role, choose **Create new IAM role** and follow the steps in [How to Create an IAM Role to Use With WorkSpaces Applications Streaming Instances](how-to-create-iam-role-to-use-with-streaming-instances.md).
   + For Elastic fleets, for **USB Redirection (advanced)**, you can specify up to 10 strings that specify what types of USB devices that are attached to the local device can be redirected into the streaming session when using the Windows native client. For more information, see [Qualify USB Devices for Use with Streaming Applications](qualify-usb-devices.md).

1. Choose **Next**.

1. If you chose to create an Always-On or On-Demand fleet, for **Step 3: Choose an Image**, choose an image that meets your needs and then choose **Next**.

1. If you chose to create an Elastic fleet, for **Step 3: Assign applications**, choose the applications that users can launch from this fleet.

1. For **Step 4: Configure Network**, do the following:
   + To add internet access for fleet instances in a VPC with a public subnet, choose **Default Internet Access**. If you are providing internet access by using a NAT gateway, leave **Default Internet Access** unselected. For more information, see [Internet Access](internet-access.md).
**Note**  
Your VPC must provide access to Amazon Simple Storage Service (S3) if you enable features that rely on saving to an S3 bucket. For more information, see [Using Amazon S3 VPC Endpoints for WorkSpaces Applications Features](managing-network-vpce-iam-policy.md). 
   + For **VPC** and **Subnet 1**, choose a VPC and at least one subnet that has access to the network resources that your application needs. For increased fault tolerance, we recommend that you choose two subnets in different Availability Zones. For more information, see [Configure a VPC with Private Subnets and a NAT Gateway](managing-network-internet-NAT-gateway.md).
**Note**  
Elastic fleets require that you specify at least two subnets that are in different availability zones.

     If you don't have your own VPC and subnet, you can use the [default VPC](default-vpc-with-public-subnet.md) or create your own. To create your own, choose the **Create a new VPC** and **Create new subnet** links to create them. Choosing these links opens the Amazon VPC console. After you create your VPC and subnets, return to the WorkSpaces Applications console and choose the refresh icon to the left of the **Create a new VPC** and **Create new subnet** links to display them in the list. For more information, see [Configure a VPC for WorkSpaces Applications](appstream-vpc.md).
   + For **Security group(s)**, choose up to five security groups to associate with this fleet. If you don't have your own security group and you don't want to use the default security group, choose the **Create new security group** link to create one. After you create your subnets in the Amazon VPC console, return to the WorkSpaces Applications console and choose the refresh icon to the left of the **Create new security group** link to display them in the list. For more information, see [Security Groups in Amazon WorkSpaces Applications](managing-network-security-groups.md).
   + For Always-On and On-Demand fleets, for **Active Directory Domain (Optional)**, choose the Active Directory and organizational unit (OU) for your streaming instance computer objects. Ensure that the network access settings you selected enable DNS resolvability and communication with your directory. For more information, see [Using Active Directory with WorkSpaces Applications](active-directory.md).

1. Choose **Next**.

1. For **Step 5: Review**, confirm the details for the fleet. To change the configuration for any section, choose **Edit **and make the needed changes. After you finish reviewing the configuration details, choose **Create**. 

1. In the pricing acknowledgement dialog box, select the acknowledgement check box, and choose **Create**.
**Note**  
If an error message notifies you that you don't have sufficient limits (quotas) to create the fleet, submit a limit increase request through the Service Quotas console at [https://console.aws.amazon.com/servicequotas/](https://console.aws.amazon.com/servicequotas/). For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*.

1. While your fleet is being created, the status of your fleets displays as **Starting** in the **Fleets** list. Choose the **Refresh** icon periodically to update the fleet status until the status is **Running**. You cannot associate the fleet with a stack and use it for streaming sessions until the status of the fleet is **Running**.

# Create a Stack in Amazon WorkSpaces Applications
<a name="set-up-stacks-fleets-install"></a>

Set up and create a stack to control access to your fleet.

**Note**  
You can enable Google Drive, OneDrive, and Application Settings Persistence only for stacks associated with a Windows fleet. Before you associate an existing stack with a Linux fleet, please make sure these settings are disabled.

**To set up and create a stack**

1. In the left navigation pane, choose **Stacks**, and then choose **Create Stack**.

1. For **Step 1: Stack Details**, Under **Stack details**, enter a unique name identifier for the stack. Optionally, you can do the following:
   + **Display name** — Enter a name to display for the stack (maximum of 100 characters).
   + **Description**— Enter a description for the stack (maximum of 256 characters).
   + **Redirect URL** — Specify a URL to which users are redirected after their streaming sessions end.
   + **Feedback URL** — Specify a URL to which users are redirected after they click the **Send Feedback** link to submit feedback about their application streaming experience. If you do not specify a URL, this link is not displayed.
   + **Fleet** — Select an existing fleet or create a new one to associate with your stack.
   + **Streaming Protocol Preference** — Specify the streaming protocol you’d like your stack to prefer, UDP or TCP. UDP is currently only supported in the Windows native client. For more information, see [System Requirements and Feature Support (WorkSpaces Applications Client)](client-system-requirements-feature-support.md).
   + **Tags** — Choose **Add Tag**, and type the key and value for the tag. To add more tags, repeat this step. For more information, see [Tagging Your Amazon WorkSpaces Applications Resources](tagging-basic.md).
   + **VPC Endpoints (Advanced)** — You can create a private link, which is an [interface VPC endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html) (interface endpoint), in your virtual private cloud (VPC). To start creating the interface endpoint, select **Create VPC Endpoint**. Selecting this link opens the VPC console. To finish creating the endpoint, follow steps 3 through 6 in *To create an interface endpoint*, in [Tutorial: Creating and Streaming from Interface VPC Endpoints](creating-streaming-from-interface-vpc-endpoints.md). 

     After you create the interface endpoint, you can use it to keep streaming traffic within your VPC.
   + **Embed WorkSpaces Applications (Optional)** — To embed an WorkSpaces Applications streaming session in a webpage, specify the domain to host the embedded streaming session. Embedded streaming sessions are only supported over HTTPS [TCP port 443]. 
**Note**  
You must meet prerequisites and perform additional steps to configure embedded WorkSpaces Applications streaming sessions. For more information, see [Embed Amazon WorkSpaces Applications Streaming Sessions](embed-streaming-sessions.md).

1. Choose **Next.**

1. For **Step 2: Enable Storage**, you can provide persistent storage for your users by choosing one or more of the following: 
   + **Home Folders** — Users can save their files to their home folder and access existing files in their home folder during application streaming sessions. For information about requirements for enabling home folders, see [Enable Home Folders for Your WorkSpaces Applications Users](enable-home-folders.md).
   + **Google Drive for Google Workspace** — Users can link their Google Drive for Google Workspace account to WorkSpaces Applications. During application streaming sessions, they can sign in to their Google Drive account, save files to Google Drive, and access their existing files in Google Drive. You can enable Google Drive for accounts in Google Workspace domains only, not for personal Gmail accounts. 
**Note**  
Enabling Google Drive is not supported for Linux-based stacks or stacks associated with multi-session fleets.
**Note**  
After you select **Enable Google Drive**, type the name of at least one organizational domain that is associated with your Google Workspace account. Access to Google Drive during application streaming sessions is limited to users that are in the domains that you specify. You can specify up to 10 domains. For more information about requirements for enabling Google Drive, see [Enable Google Drive for Your WorkSpaces Applications Users](enable-google-drive.md).
   + **OneDrive for Business** — Users can link their OneDrive for Business account to WorkSpaces Applications. During application streaming sessions, they can sign in to their OneDrive account, save files to OneDrive, and access their existing files in OneDrive. You can enable OneDrive for accounts in OneDrive domains only, not for personal accounts. 
**Note**  
Enabling OneDrive is not supported for Linux-based stacks or stacks associated with multi-session fleets..
**Note**  
After you select **Enable OneDrive**, enter the name of least one organizational domain that is associated with your OneDrive account. Access to OneDrive during application streaming sessions is limited to users that are in the domains that you specify. You can specify up to 10 domains. For more information about requirements for enabling OneDrive, see [Enable OneDrive for Your WorkSpaces Applications Users](enable-onedrive.md).

1. Choose **Next**.

1. For **Step 3: User Settings**, configure the following settings. When you're done, choose **Review**. 

   **Clipboard, file transfer, print to local device, and authentication permissions**:
**Note**  
**Smart card sign in for Active Directory** is currently not available for multi-session fleets.
   + **Clipboard** — By default, users can copy and paste data between their local device and streaming applications. You can limit Clipboard options so that users can paste data to their remote streaming session only or copy data to their local device only. You can also disable Clipboard options entirely. Users can still copy and paste between applications in their streaming session. You can choose **Copy to local device character limit** or **Paste to remote session character limit** or both to limit the amount of data that users can copy or paste when using the clipboard, either in or out of their WorkSpaces Applications streaming session. The value can be between 1 and 20,971,520 (20 MB), and defaults to the maximum value when unspecified.
   + **File transfer** — By default, users can upload and download files between their local device and streaming session. You can limit file transfer options so that users can upload files to their streaming session only or download files to their local device only. You can also disable file transfer entirely. 
**Important**  
If your users require WorkSpaces Applications file system redirection to access local drives and folders during their streaming sessions, you must enable both file upload and download. To use file system redirection, your users must have WorkSpaces Applications client version 1.0.480 or later installed. For more information, see [Enable File System Redirection for Your WorkSpaces Applications Users](enable-file-system-redirection.md).
   + **Print to local device** — By default, users can print to their local device from within a streaming application. When they choose **Print** in the application, they can download a .pdf file that they can print to a local printer. You can disable this option to prevent users from printing to a local device.
   + **Password sign in for Active Directory** — Users can enter their Active Directory domain password to sign in to an WorkSpaces Applications streaming instance that is joined to an Active Directory domain. 

     You can also enable **Smart card sign in for Active Directory**. At least one authentication must be enabled.
   + **Smart card sign in for Active Directory** — Users can use a smart card reader and smart card connected to their local computer to sign in to an WorkSpaces Applications streaming instance that is joined to an Active Directory domain.

     You can also enable** Password sign in for Active Directory**. At least one authentication method must be enabled.
**Note**  
**Clipboard, file transfer, and print to local device settings** — These settings control only whether users can use WorkSpaces Applications data transfer features. If your image provides access to a browser, network printer, or other remote resource, your users might be able to transfer data to or from their streaming session in other ways.  
**Authentication settings** — These settings control only the authentication method that can be used for Windows sign in to an WorkSpaces Applications streaming instance (fleet or image builder). They do not control the authentication method that can be used for in-session authentication, after a user signs in to a streaming instance. For information about configuration requirements for using smart cards for Windows sign in and in-session authentication, see [Smart Cards](feature-support-USB-devices-qualified.md#feature-support-USB-devices-qualified-smart-cards). These settings are not supported for Linux-based stacks.

   **Time zone**:
   + **Set time zone automatically for remote session** — This setting syncs the time zone used for streaming to match the time zone set on the user's device. Users can override this and set their own preferred time zone.

   **Application settings persistence**:
   + **Enable Application Settings Persistence** — Users' application customizations and Windows settings are automatically saved after each streaming session and applied during the next session. These settings are saved to an Amazon Simple Storage Service (Amazon S3) bucket in your account, within the AWS Region in which application settings persistence is enabled.
   + **Settings Group** — The settings group determines which saved application settings are used for a streaming session from this stack. If the same settings group is applied to another stack, both stacks use the same application settings. By default, the settings group value is the name of the stack.
**Note**  
For information about requirements for enabling and administering application settings persistence, see [Enable Application Settings Persistence for Your WorkSpaces Applications Users](app-settings-persistence.md).

1. For **Step 4: Review**, confirm the details for the stack. To change the configuration for any section, choose **Edit **and make the needed changes. After you finish reviewing the configuration details, choose **Create**. 

After the service sets up resources, the **Stacks** page appears. The status of your new stack appears as **Active** when it is ready to use. 

# Provide Access to Users in Amazon WorkSpaces Applications
<a name="set-up-stacks-fleets-add"></a>

After you create a stack with an associated fleet, you can provide access to users through the WorkSpaces Applications user pool, SAML 2.0 [single sign-on (SSO)], or the WorkSpaces Applications API. For more information, see [User Pool Administration in Amazon WorkSpaces Applications](user-pool-admin.md) and [Amazon WorkSpaces Applications Integration with SAML 2.0](external-identity-providers.md). 

**Note**  
Users in the WorkSpaces Applications user pool can't be assigned to stacks with fleets that are joined to an Active Directory domain.

After you provide your users with access to WorkSpaces Applications, they can start WorkSpaces Applications streaming sessions by using a web browser or by using the WorkSpaces Applications client application for a supported device. If you provide access to users through the WorkSpaces Applications user pool, they must use a web browser for streaming sessions. If you use SAML 2.0 or the WorkSpaces Applications API, you can make the WorkSpaces Applications client available to them. The WorkSpaces Applications client is a native application that is designed for users who require additional functionality during their WorkSpaces Applications streaming sessions. For more information, see [Provide Access Through the WorkSpaces Applications Client](client-application.md).

# Clean Up Resources in Amazon WorkSpaces Applications
<a name="set-up-stacks-fleets-finish"></a>

You can stop your running fleet and delete your active stack to free up resources and to avoid unintended charges to your account. We recommend stopping any unused, running fleets.

Note that you cannot delete a stack with an associated fleet.

**To clean up your resources**

1. In the navigation pane, choose **Stacks**.

1. Select the stack and choose **Actions**, **Disassociate Fleet**. In the confirmation dialog box, choose **Disassociate.**

1. In the navigation pane, choose **Fleets**.

1. Select the fleet that you want to stop, choose **Actions**, and then choose **Stop**. It takes about 5 minutes to stop a fleet.

1. When the status of the fleet is **Stopped**, choose **Actions**, **Delete**.

1. In the navigation pane, choose **Stacks**.

1. Select the stack and choose **Actions**, **Delete**.

# Customize an Amazon WorkSpaces Applications Fleet to Optimize Your Users' Application Streaming Experience
<a name="customize-fleets"></a>

By customizing WorkSpaces Applications fleet instances, you can define specific aspects of your WorkSpaces Applications environment to optimize your users' application streaming experience. For example, you can persist environment variables to dynamically pass settings across applications and set default file associations that are applied to all of your users. At a high level, customizing a fleet instance includes the following tasks: 
+ Connecting to an image builder and customizing it as needed.
+ On the image builder, using Image Assistant to create a new image that includes your customizations.
+ Creating a new fleet instance or modifying an existing one. When you configure the fleet instance, select the new customized image that you created.
+ Creating a new stack or modifying an existing one and associating it with your fleet instance.

**Note**  
For certain fleet customizations, in Active Directory environments, you might need to use the Group Policy Management Console (GPMC) to update Group Policy object (GPO) settings on a domain-joined computer.

**Topics**
+ [Persist Environment Variables in Amazon WorkSpaces Applications](customize-fleets-persist-environment-variables.md)
+ [Set Default File Associations for Your Users in Amazon WorkSpaces Applications](customize-fleets-set-default-file-associations.md)
+ [Disable Internet Explorer Enhanced Security Configuration in Amazon WorkSpaces Applications](customize-fleets-disable-ie-esc.md)
+ [Change the Default Internet Explorer Home Page for Users' Streaming Sessions in Amazon WorkSpaces Applications](customize-fleets-change-ie-homepage.md)
+ [User and Instance Metadata for Amazon WorkSpaces Applications Fleets](customize-fleets-user-instance-metadata-fleets.md)

# Persist Environment Variables in Amazon WorkSpaces Applications
<a name="customize-fleets-persist-environment-variables"></a>

Environment variables enable you to dynamically pass settings across applications. For example, many engineering applications rely on environment variables to specify the IP address or host name of a license server to locate and check out a license from that server. 

Follow the steps in these procedures to make environment variables available across your fleet instances. 

**Note**  
The following instructions apply to Windows fleets only. 

**Topics**
+ [Change System Environment Variables](customize-fleets-system-environment-variables.md)
+ [Change User Environment Variables](customize-fleets-user-environment-variables.md)
+ [Create an Environment Variable That is Limited in Scope](customize-fleets-environment-variable-limited-scope.md)

**Note**  
If you are using Active Directory and Group Policy with WorkSpaces Applications, keep in mind that streaming instances must be joined to an Active Directory domain to use Group Policy for environment variables. For information about how to configure the Group Policy **Environment Variable** preference item, see [Configure an Environment Variable Item](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc772047(v=ws.11)) in the Microsoft documentation.

# Change System Environment Variables
<a name="customize-fleets-system-environment-variables"></a>

Follow these steps to change system environment variables across your fleet instances. 

**To change system environment variables on an image builder**

This procedure applies only to system environment variables, not user environment variables. To change user environment variables that persist across your fleet instances, perform the steps in the next procedure.

1. Connect to the image builder on which to change system environment variables and sign in with an account that has local administrator permissions. To do so, do either of the following: 
   + [Use the WorkSpaces Applications console](managing-image-builders-connect-console.md) (for web connections only)
   + [Create a streaming URL](managing-image-builders-connect-streaming-URL.md) (for web or WorkSpaces Applications client connections)
**Note**  
If the image builder that you want to connect to is joined to an Active Directory domain and your organization requires smart card sign in, you must create a streaming URL and use the WorkSpaces Applications client for the connection. For information about smart card sign in, see [Smart Cards](feature-support-USB-devices-qualified.md#feature-support-USB-devices-qualified-smart-cards).

1. Choose the Windows **Start** button, open the context (right-click) menu for **Computer**, and then choose **Properties**.

1. In the navigation pane, choose **Advanced system settings**. 

1. In **System variables**, change the environment variables that you want to persist across your fleet instances, and then choose** OK**.

1. On the image builder desktop, open Image Assistant.

1. Follow the necessary steps in Image Assistant to finish creating your image. For more information, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md).

   The changes to the system environment variables persist across your fleet instances and are available to streaming sessions launched from those instances. 
**Note**  
Setting AWS CLI credentials as system environment variables might prevent WorkSpaces Applications from creating the image.

# Change User Environment Variables
<a name="customize-fleets-user-environment-variables"></a>

Follow these steps to change user environment variables across your fleet instances. 

**To change user environment variables**

1. Connect to the image builder on which to change system environment variables and sign in as a **Template User**. To do so, do either of the following: 
   + [Use the WorkSpaces Applications console](managing-image-builders-connect-console.md) (for web connections only)
   + [Create a streaming URL](managing-image-builders-connect-streaming-URL.md) (for web or WorkSpaces Applications client connections)
**Note**  
If the image builder that you want to connect to is joined to an Active Directory domain and your organization requires smart card sign in, you must create a streaming URL and use the WorkSpaces Applications client for the connection. For information about smart card sign in, see [Smart Cards](feature-support-USB-devices-qualified.md#feature-support-USB-devices-qualified-smart-cards).

   **Template User** lets you create default application and Windows settings for your users. For more information, see "Creating Default Application and Windows Settings for Your WorkSpaces Applications Users" in [Default Application and Windows Settings and Application Launch Performance in Amazon WorkSpaces Applications](customizing-appstream-images.md).

1. On the image builder, choose the Windows **Start** button, **Control Panel**, **User Accounts**. 

1. Choose **User Accounts** again. In the left navigation pane, choose **Change my environment variables.**

1. Under **User environment variables** for **DefaultProfileUser**, set or create the user environment variables as needed, then choose **OK**.

1. This disconnects your current session and opens the login menu. Log in to the image builder by doing either of the following:
   + If your image builder is not joined to an Active Directory domain, on the **Local User** tab, choose **Administrator**.
   + If your image builder is joined to an Active Directory domain, choose the **Directory User** tab, and log in as a domain user who has local administrator permissions on the image builder.

1. On the image builder desktop, open Image Assistant.

1. Follow the necessary steps in Image Assistant to finish creating your image. For more information, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md).

# Create an Environment Variable That is Limited in Scope
<a name="customize-fleets-environment-variable-limited-scope"></a>

Follow these steps to create an environment variable that is limited in scope to the processes that are spawned off the script. This approach is useful when you need to use the same environment variable name with different values for different applications. For example, if you have two different applications that use the environment variable "LIC\$1SERVER", but each application has a different value for "LIC\$1SERVER".

**To create an environment variable that is limited in scope**

1. Connect to the image builder on which to create an environment variable that is limited in scope and sign in with an account that has local administrator permissions. To do so, do either of the following: 
   + [Use the WorkSpaces Applications console](managing-image-builders-connect-console.md) (for web connections only)
   + [Create a streaming URL](managing-image-builders-connect-streaming-URL.md) (for web or WorkSpaces Applications client connections)
**Note**  
If the image builder that you want to connect to is joined to an Active Directory domain and your organization requires smart card sign in, you must create a streaming URL and use the WorkSpaces Applications client for the connection. For information about smart card sign in, see [Smart Cards](feature-support-USB-devices-qualified.md#feature-support-USB-devices-qualified-smart-cards).

1. Create a child folder of C:\$1 drive for the script (for example, C:\$1Scripts).

1. Open Notepad to create the new script, and enter the following lines:

   `set `*variable*=*value*

   `start " " "C:\path\to\application.exe"` 

   Where:

   *variable* is the variable name to be used

   *value* is the value for the given variable name
**Note**  
If the application path includes spaces, the entire string must be encapsulated within quotation marks. For example:   
`start " " "C:\Program Files\application.exe"`

1. Choose** File**, **Save**. Name the file and save it with the .bat extension to C:\$1Scripts. For example, name the file LaunchApp.bat.

1. If needed, repeat steps 4 and 5 to create a script for each additional application that requires its own environment variable and values. 

1. On the image builder desktop, start Image Assistant.

1. Choose **Add App**, navigate to C:\$1Scripts, and select one of the scripts that you created in step 5. Choose **Open**.

1. In the **App Launch Settings** dialog box, keep or change the settings as needed. When you're done, choose **Save**.

1. If you created multiple scripts, repeat steps 8 and 9 for each script.

1. Follow the necessary steps in Image Assistant to finish creating your image. For more information, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md).

   The environment variable and specific value are now available for processes that are run from the script. Other processes cannot access this variable and value. 

# Set Default File Associations for Your Users in Amazon WorkSpaces Applications
<a name="customize-fleets-set-default-file-associations"></a>

The associations for application file extensions are set on a per-user basis and so are not automatically applied to all users who launch WorkSpaces Applications streaming sessions. For example, if you set Adobe Reader as the default application for .pdf files on your image builder, this change is not applied to your users. 

**Note**  
The following steps apply to Windows fleets only.

**Note**  
The following steps must be performed on an image builder that is joined to an Active Directory domain. In addition, your fleet must be joined to an Active Directory domain. Otherwise, the default file associations that you set are not applied.

**To set default file associations for your users**

1. Connect to the image builder on which to set default file associations and sign in with a domain account that has local administrator permissions on the image builder. To do so, do either of the following: 
   + [Use the WorkSpaces Applications console](managing-image-builders-connect-console.md) (for web connections only)
   + [Create a streaming URL](managing-image-builders-connect-streaming-URL.md) (for web or WorkSpaces Applications client connections)
**Note**  
If your organization requires smart card sign in, you must create a streaming URL and use the WorkSpaces Applications client for the connection. For information about smart card sign in, see [Smart Cards](feature-support-USB-devices-qualified.md#feature-support-USB-devices-qualified-smart-cards).

1. Set default file associations as needed.

1. Open the Windows command prompt as an administrator.

1. At the command prompt, type the following command to export the image builder file associations as an XML file, and then press ENTER: 

   `dism.exe /online /export-DefaultAppAssociations:c:\default_associations.xml`

   If you receive an error message stating that you cannot service a running 64-bit operating system with a 32-bit version of DISM, close the command prompt window. Open File Explorer, browse to C:\$1Windows\$1System32, right-click cmd.exe, choose **Run as Administrator**, and run the command again.

1. You can use either Local Group Policy Editor or the GPMC to set a default associations configuration file:
   + Local Group Policy Editor:

     On your image builder, open the command prompt as an administrator, type `gpedit.msc`, and then press ENTER. 

     In the console tree, under **Computer Configuration**, expand **Administrative Templates**, **Windows Components**, and then choose **File Explorer**.
   + GPMC: 

     In your directory or on a domain controller, open the command prompt as an administrator, type `gpmc.msc`, and then press ENTER.

     In the left console tree, select the OU in which you want to create a new GPO, or use an existing GPO, and then do either of the following:
     + Create a new GPO by opening the context (right-click) menu and choosing **Create a GPO in this domain, Link it here**. For **Name**, provide a descriptive name for this GPO.
     + Select an existing GPO.

     Open the context menu for the GPO, and choose **Edit**.

     Under **User Configuration**, expand **Policies**, **Administrative Templates**, **Windows Components**, and then choose **File Explorer**. 

1. Double-click **Set a default associations configuration file**.

1. In the **Set a default associations configuration file properties** dialog box, choose **Enabled**, and do one of the following:
   + If you are using Local Group Policy Editor, enter this path: `c:\default_associations.xml`. 
   + If you are using the GPMC, enter a network path. For example, `\\networkshare\default_associations.xml`.

1. Choose **Apply**, **OK**.

1. Close Local Group Policy Editor or the GPMC.

1. On the image builder desktop, open Image Assistant.

1. Follow the necessary steps in Image Assistant to finish creating your image. For more information, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md).

   The file associations that you configured are applied to the fleet instances and user streaming sessions that are launched from those instances. 

# Disable Internet Explorer Enhanced Security Configuration in Amazon WorkSpaces Applications
<a name="customize-fleets-disable-ie-esc"></a>

Internet Explorer Enhanced Security Configuration (ESC) places servers and Internet Explorer in a configuration that limits exposure to the internet. However, this configuration can impact the WorkSpaces Applications end user experience. Users who are connected to WorkSpaces Applications streaming sessions may find that websites do not display or perform as expected when: 
+ Internet Explorer ESC is enabled on fleet instances from which users' streaming sessions are launched
+ Users run Internet Explorer during their streaming sessions
+ Applications use Internet Explorer to load data

**Note**  
The following steps apply to Windows fleets only.

**To disable Internet Explorer Enhanced Security Configuration**

1. Connect to the image builder on which to disable Internet Explorer ESC and sign in with an account that has local administrator permissions. To do so, do either of the following: 
   + [Use the WorkSpaces Applications console](managing-image-builders-connect-console.md) (for web connections only)
   + [Create a streaming URL](managing-image-builders-connect-streaming-URL.md) (for web or WorkSpaces Applications client connections)
**Note**  
If the image builder that you want to connect to is joined to an Active Directory domain and your organization requires smart card sign in, you must create a streaming URL and use the WorkSpaces Applications client for the connection. For information about smart card sign in, see [Smart Cards](feature-support-USB-devices-qualified.md#feature-support-USB-devices-qualified-smart-cards).

1. On the image builder, disable Internet Explorer ESC by doing the following:

   1. Open Server Manager. Choose the Windows **Start** button, and then choose **Server Manager**.

   1. In the left navigation pane, choose **Local Server**. 

   1. In the right properties pane, choose the **On** link next to IE Enhanced Security Configuration****.

   1. In the **Internet Explorer Enhanced Configuration** dialog box, choose the **Off** option under **Administrators** and **Users**, then choose **OK**.

1. In the upper right area of the image builder desktop, choose **Admin Commands**, **Switch User**.   
![\[Admin Commands dropdown menu with Switch User option highlighted.\]](http://docs.aws.amazon.com/appstream2/latest/developerguide/images/admin-commands-switch-user.png)

1. This disconnects your current session and opens the login menu. Log in to the image builder by doing either of the following:
   + If your image builder is not joined to an Active Directory domain, on the **Local User** tab, choose **Template User**.
   + If your image builder is joined to an Active Directory domain, choose the **Directory User** tab, and log in as a domain user who does not have local administrator permissions on the image builder.

1. Open Internet Explorer and reset your settings by doing the following:

   1. In the upper right area of the Internet Explorer browser window, choose the **Tools** icon, then choose **Internet options**.

   1. Choose the **Advanced **tab, then choose **Reset**.

   1. When prompted to confirm your choice, choose **Reset** again.

   1. When the **Reset Internet Explorer Settings** message displays, choose **Close**.

1. Reboot image builder.

1. Choose **Admin Commands**, **Switch User**, and then do either of the following: 
   + If your image builder is not joined to an Active Directory domain, on the **Local User** tab, choose **Administrator**.
   + If your image builder is joined to an Active Directory domain, choose the **Directory User** tab, and log in with the same domain account that you used in step 4.

1. On the image builder desktop, open Image Assistant.

1. In **Step 2. Configure Apps**, choose **Save settings**.

1. Follow the necessary steps in Image Assistant to finish creating your image. For more information, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md).

# Change the Default Internet Explorer Home Page for Users' Streaming Sessions in Amazon WorkSpaces Applications
<a name="customize-fleets-change-ie-homepage"></a>

You can use Group Policy to change the default Internet Explorer home page for users' streaming sessions. Alternatively, if you do not have Group Policy in your environment or prefer not to use Group Policy, you can use the WorkSpaces Applications Template User account instead.

**Note**  
The following steps apply to Windows fleets only.

**Topics**
+ [Use Group Policy to Change the Default Internet Explorer Home Page](customize-fleets-change-ie-homepage-group-policy.md)
+ [Use the WorkSpaces Applications Template User Account to Change the Default Internet Explorer Home Page](customize-fleets-change-ie-homepage-template-user.md)

# Use Group Policy to Change the Default Internet Explorer Home Page
<a name="customize-fleets-change-ie-homepage-group-policy"></a>

In Active Directory environments, you use the Group Policy Management (GPMC) MMC-snap-in to set a default home page that users can't change. If Active Directory is not in your environment, you can use Local Group Policy Editor to perform this task. To set a home page that users can change, you must use the GPMC. 

To use the GPMC, do the following first:
+ Obtain access to a computer or an EC2 instance that is joined to your domain.
+ Install the GPMC. For more information, see [Installing or Removing Remote Server Administration Tools for Windows 7](https://technet.microsoft.com/en-us/library/ee449483.aspx) in the Microsoft documentation.
+ Log in as a domain user with permissions to create GPOs. Link GPOs to the appropriate organizational units (OUs).

**To change the default Internet Explorer home page by using a Group Policy administrative template**

You can use a Group Policy administrative template to set a default home page that users can't change. For more information about administrative templates, see [Edit Administrative Template Policy Settings](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771479(v=ws.11)) in the Microsoft documentation.

1. Open the WorkSpaces Applications console at [https://console.aws.amazon.com/appstream2/home](https://console.aws.amazon.com/appstream2/home).

1. If you are not using Active Directory in your environment, open Local Group Policy Editor. If you are using Active Directory, open the GPMC. Locate the **Scripts (Logon\$1Logoff) **policy setting: 
   + Local Group Policy Editor: 

     On your image builder, open the command prompt as an administrator, type `gpedit.msc`, and then press ENTER. 

     Under **User Configuration**, expand **Administrative Templates**, **Windows Components**, and then choose **Internet Explorer**. 
   + GPMC: 

     In your directory or on a domain controller, open the command prompt as an administrator, type `gpmc.msc`, and then press ENTER.

     In the left console tree, select the OU in which you want to create a new GPO, or use an existing GPO, and then do either of the following: : 
     + Create a new GPO by opening the context (right-click) menu and choosing **Create a GPO in this domain, Link it here**. For **Name**, provide a descriptive name for this GPO.
     + Select an existing GPO.

     Open the context menu for the GPO, and choose **Edit**.

     Under **User Configuration**, expand **Policies**, **Administrative Templates**, **Windows Components**, and then choose **Internet Explorer**. 

1. Double-click **Disable changing home page settings**, choose **Enabled**, and in **Home Page**, enter a URL.

1. Choose **Apply**, **OK**.

1. Close Local Group Policy Editor or the GPMC.

**To change the default Internet Explorer home page by using Group Policy preferences**

You can use Group Policy preferences to set a default home page that users can change. For more information about working with Group Policy preferences, see [Configure a Registry Item](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc753092(v=ws.11)) and [Group Policy Preferences Getting Started Guide ](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc731892(v=ws.10)) in the Microsoft documentation.

1. In your directory or on a domain controller, open the command prompt as an administrator, type `gpmc.msc`, and then press ENTER.

1. In the left console tree, select the OU in which you want to create a new GPO, or use an existing GPO, and then do either of the following: 
   + Create a new GPO by opening the context (right-click) menu and choosing **Create a GPO in this domain, Link it here**. For **Name**, provide a descriptive name for this GPO.
   + Select an existing GPO.

1. Open the context menu for the GPO, and choose **Edit**. 

1. Under **User Configuration**, expand **Preferences**, and then choose **Windows Settings**. 

1. Open the context (right-click) menu for **Registry** and choose **New**, **Registry Item**.

1. In the **New Registry Properties** dialog box, specify the following registry settings for Group Policy to configure: 
   + For **Action**, choose **Update**. 
   + For **Hive**, choose **HKEY\$1CURRENT\$1USER**.
   + For **Key Path**, browse to and select HKEY\$1CURRENT\$1USER\$1SOFWARE\$1Microsoft\$1Internet Explorer\$1Main.
   + For **Value Name**, enter **Start Page**.
   + For **Value Data**, enter your home page URL.

1. On the **Common **tab, choose **Apply Once**, **Do not Re-Apply**. 
**Note**  
To enable your users to choose the **Use Default** button in their Internet Explorer browser settings and reset their default home page to your company home page, you can also set a value for Default\$1Page\$1URL without choosing **Apply Once** and **Do not Re-Apply**. 

1. Choose **OK** and close the GPMC.

# Use the WorkSpaces Applications Template User Account to Change the Default Internet Explorer Home Page
<a name="customize-fleets-change-ie-homepage-template-user"></a>

Follow these steps to use the **Template User** account to change the default Internet Explorer home page. 

**To change the default Internet Explorer Home page by using the Template User account**

1. Connect to the image builder on which to change the default Internet Explorer home page and sign in with the **Template User** account. To do so, do either of the following: 
   + [Use the WorkSpaces Applications console](managing-image-builders-connect-console.md) (for web connections only)
   + [Create a streaming URL](managing-image-builders-connect-streaming-URL.md) (for web or WorkSpaces Applications client connections)
**Note**  
If the image builder that you want to connect to is joined to an Active Directory domain and your organization requires smart card sign in, you must create a streaming URL and use the WorkSpaces Applications client for the connection. For information about smart card sign in, see [Smart Cards](feature-support-USB-devices-qualified.md#feature-support-USB-devices-qualified-smart-cards).

   **Template User** lets you create default application and Windows settings for your users. For more information, see "Creating Default Application and Windows Settings for Your WorkSpaces Applications Users" in [Default Application and Windows Settings and Application Launch Performance in Amazon WorkSpaces Applications](customizing-appstream-images.md).

1. Open Internet Explorer and complete the necessary steps to change the default home page.

1. In the upper right area of the image builder desktop, choose **Admin Commands**, **Switch User**.   
![\[Admin Commands dropdown menu with Switch User option highlighted.\]](http://docs.aws.amazon.com/appstream2/latest/developerguide/images/admin-commands-switch-user.png)

1. This disconnects your current session and opens the login menu. Log in to the image builder by doing either of the following:
   + If your image builder is not joined to an Active Directory domain, on the **Local User** tab, choose **Administrator**.
   + If your image builder is joined to an Active Directory domain, choose the **Directory User** tab, and log in as a domain user who has local administrator permissions on the image builder.

1. On the image builder desktop, open Image Assistant.

1. Follow the necessary steps in Image Assistant to finish creating your image. For more information, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md).

# User and Instance Metadata for Amazon WorkSpaces Applications Fleets
<a name="customize-fleets-user-instance-metadata-fleets"></a>

WorkSpaces Applications fleet instances have user and instance metadata available through Windows environment variables. You can use the following environment variables in your applications and scripts to modify your environment based on the fleet instance details.


| Environment Variable | Context | Description | 
| --- | --- | --- | 
| AppStream\$1Stack\$1Name | User | The name of the stack from which the streaming session started. | 
| AppStream\$1User\$1Access\$1Mode | User | The access mode used to manage user access to the stream. The available values are custom, userpool, or saml. | 
| AppStream\$1Session\$1Reservation\$1DateTime | User | The date and time when the user's streaming session started. | 
| AppStream\$1UserName | User | The user name associated with the user. | 
| AppStream\$1Session\$1ID | User | The session identifier for the user's streaming session. | 
| APPSTREAM\$1SESSION\$1CONTEXT | Machine | Contains the parameters passed to your streaming application when a session is started. For more information, see [Session Context in Amazon WorkSpaces Applications](managing-stacks-fleets-session-context.md). This environment variable is only available after the first application launch.  | 
| AppStream\$1Image\$1Arn | Machine | The ARN of the image that was used to create the streaming instance. | 
| AppStream\$1Instance\$1Type | Machine | The streaming instance's type. For example, stream.standard.medium. | 
| AppStream\$1Resource\$1Type | Machine | The type of WorkSpaces Applications resource. The value is either fleet or image-builder. | 
| AppStream\$1Resource\$1Name | Machine | The fleet's name. | 

On Linux fleet instances, these environment variables are exported through the following profile.d scripts:
+ **User environment variables** in /etc/profile.d/appstream\$1user\$1vars.sh
+ **System environment variables** in /etc/profile.d/appstream\$1system\$1vars.sh

To access the environment variables, you must explicitly source these files in your applications.

# Update an Amazon WorkSpaces Applications Fleet
<a name="update-fleets-new-image"></a>

You can make updates to an existing WorkSpaces Applications fleet. 

When you create a new WorkSpaces Applications image, you must update your Always-On and On-Demand fleets to make the applications and data on the new image available to users. If your update is minor (for example, patching applications or the operating system), you can update your running fleet. When new streaming instances are created, they are created from the updated image. Changing the image on a running fleet does not disrupt users who have active streaming sessions. Unused streaming instances are replaced periodically, while streaming instances that users are connected to are terminated after the streaming sessions are finished. 

You can update a fleet with a new image that runs the same operating system when the fleet is in a **Running** or **Stopped** state. However, you can update a fleet with a new image that runs a different operating system only when the fleet is in a **Stopped** state.

**Note**  
The application catalog that WorkSpaces Applications displays to users is based on the current image that is associated with the fleet. If the updated image contains applications that are not specified in the older image, the applications may not launch if the user streams from an instance that is based on the older image.

**Topics**
+ [Update a Fleet with a New Image in Amazon WorkSpaces Applications](update-fleets.md)
+ [Manage Applications Associated to an Elastic Fleet in Amazon WorkSpaces Applications](manage-apps.md)

# Update a Fleet with a New Image in Amazon WorkSpaces Applications
<a name="update-fleets"></a>

To apply operating system updates or make new applications available to users, create a new image that has these changes. Then, update the fleet with the new image. 

**To update an WorkSpaces Applications fleet with a new image**

1. Connect to the image builder that you want to use and sign in with an account that has local administrator permissions on the image builder. To do so, do either of the following: 
   + [Use the WorkSpaces Applications console](managing-image-builders-connect-console.md) (for web connections only)
   + [Create a streaming URL](managing-image-builders-connect-streaming-URL.md) (for web or WorkSpaces Applications client connections)
**Note**  
If your organization requires smart card sign in, you must create a streaming URL and use the WorkSpaces Applications client for the connection. For information about smart card sign in, see [Smart Cards](feature-support-USB-devices-qualified.md#feature-support-USB-devices-qualified-smart-cards).

1. Do either or both of the following as required: 
   + Install updates to the operating system.
   + Install applications.

     If an application requires the Windows operating system to restart, let it do so. Before the operating system restarts, you are disconnected from your image builder. After the restart is complete, connect to the image builder again, then finish installing the application.

1. On the image builder desktop, open Image Assistant. 

1. Follow the necessary steps in Image Assistant to finish creating your image. For more information, see [Tutorial: Create a Custom WorkSpaces Applications Image by Using the WorkSpaces Applications Console](tutorial-image-builder.md).

   After the image status changes to **Available**, you can update the fleet with your new image.

1. In the left navigation pane, choose **Fleets**.

1. Select the fleet that you want to update with the new image. 

1. On the **Fleet Details** tab, choose **Edit**.

1. In the **Edit Fleet** dialog box, the list of available images displays in the **Name** list. Select the new image from the list. 

1. Choose **Update**.

**Note**  
All existing instances and user sessions will continue to run with the old image, but all new instance launches will spin up from the new image. For multi-session fleets, it is possible that instances keep running with the older image for a longer duration of time because the service will not terminate an instance if there is an active session on the instance, and if user sessions keep getting provisioned on these instances, it is possible the instance will continue to run with the old image. To get rid of long-running instances on multi-session fleets, evaluate the option of putting them in drain mode. To learn more, refer to [Manage Multi-Session Fleet Instances](manage-multi-session-instances.md).

# Manage Applications Associated to an Elastic Fleet in Amazon WorkSpaces Applications
<a name="manage-apps"></a>

You can associate and disassociate applications from an Elastic fleet at any time. Changes to the applications associated to an Elastic fleet are visible to users currently streaming from the fleet, but may not take effect. For example, if you disassociate an application from a fleet, it will be removed from the application catalog, but the virtual hard disk will remain mounted to existing streaming sessions.

**To manage applications associated to an Elastic fleet**

1. Open the [WorkSpaces Applications console](managing-image-builders-connect-console.md).

1. In the left navigation pane, choose **Fleets**, then either select the name of the fleet, or select the fleet radio button, then choose **View details**.

1. To associate a new application to the fleet, choose **Associate** in **Assigned applications**, select the application to be associated, and choose **Associate**.

1. To disassociate an existing application from the fleet, select the application to disassociate, choose **Disassociate**, and confirm that you want to disassociate the selected application by choosing **Disassociate**.

# Fleet Auto Scaling for Amazon WorkSpaces Applications
<a name="autoscaling"></a>

Fleet Auto Scaling lets you change the size of your WorkSpaces Applications Always-On or On-Demand fleet automatically to match the supply of available instances to user demand. The size of your fleet determines the number of users who can stream concurrently. For a multi-session fleet, more than one user can use a single instance. For a non multi-session fleet, one instance is required for each user session. You can specify your fleet capacity in terms of instances (for single-session fleets) and user sessions (for multi-session fleets). Based on your fleet configurations and auto scaling policies, the required number of instances will be made available. You can define scaling policies that adjust the size of your fleet automatically based on a variety of utilization metrics, and optimize the number of available instances to match user demand. You can also choose to turn off automatic scaling and make the fleet run at a fixed size.

**Note**  
Elastic fleet capacity is automatically managed by WorkSpaces Applications for you. You do not need to create auto scaling rules to manage the number of fleet streaming instances that are available for Elastic fleets.

**Note**  
As you develop your plan for WorkSpaces Applications fleet scaling, make sure that your network configuration meets your requirements. 

Before you can use Fleet Auto Scaling, Application Auto Scaling needs permissions to access Amazon CloudWatch alarms and WorkSpaces Applications fleets. For more information, see [Using AWS Managed Policies and Linked Roles to Manage Administrator Access to WorkSpaces Applications Resources](controlling-administrator-access-with-policies-roles.md) and [Using IAM Policies to Manage Administrator Access to Application Auto Scaling](autoscaling-iam-policy.md).

**Note**  
When you use scaling, you work with the Application Auto Scaling API. For Fleet Auto Scaling to work correctly for WorkSpaces Applications, Application Auto Scaling requires permission to describe and update your WorkSpaces Applications fleets and describe your Amazon CloudWatch alarms, and permissions to modify your fleet capacity on your behalf. For more information, see [Roles Required for WorkSpaces Applications, Application Auto Scaling, and AWS Certificate Manager Private CA](roles-required-for-appstream.md) and [Using IAM Policies to Manage Administrator Access to Application Auto Scaling](autoscaling-iam-policy.md).

The following topics provide information to help you understand and use WorkSpaces Applications Fleet Auto Scaling. 

**Topics**
+ [Scaling Concepts for Amazon WorkSpaces Applications](autoscaling-concepts.md)
+ [Managing Fleet Scaling Using the Amazon WorkSpaces Applications Console](autoscaling-console.md)
+ [Managing Fleet Scaling Using the AWS CLI for Amazon WorkSpaces Applications](autoscaling-cli.md)
+ [Additional Resources for Auto Scaling Amazon WorkSpaces Applications](autoscaling-additional-resources.md)

# Scaling Concepts for Amazon WorkSpaces Applications
<a name="autoscaling-concepts"></a>

WorkSpaces Applications scaling is provided by Application Auto Scaling. For more information, see the [Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/).

For step-by-step guidance for working with WorkSpaces Applications Fleet Auto Scaling, see [Scaling Your Desktop Application Streams with Amazon AppStream 2.0](https://aws.amazon.com/blogs/compute/scaling-your-desktop-application-streams-with-amazon-appstream-2-0/) in the *AWS Compute Blog*.

To use Fleet Auto Scaling effectively, you must understand the following terms and concepts.

**Multi-session vs. Single-session**  
In a single-session scenario, each user session has its own dedicated instance. In a multi-session mode, more than one user session can be provisioned on an instance. Fleet capacity and auto scaling policies must be configured in terms of user sessions, and the service will calculate and launch the required number of instances. 

**Minimum Capacity/Minimum User Sessions for fleet**  
The minimum number of instances (for single session fleets) or user sessions (for multi-session fleets). The number of instances (for single session fleets) or user sessions (for multi-session fleets) can't be below this value, and scaling policies will not scale your fleet below this value. For example, in a single-session scenario, if you set the minimum capacity for a fleet to 2, your fleet will never have less than 2 instances. Similarly, in a multi-session scenario, with the maximum number of sessions on an instance set to 5, if you set the minimum capacity for a fleet to 12, your fleet will never have less than roundup (12/5) = 3 instances.

**Maximum Capacity/Maximum User Sessions for fleet**  
The maximum number of instances (for single session fleets) or user sessions (for multi-session fleets). The number of instances (for single session fleets) or user sessions (for multi-session fleets) can't be above this value, and scaling policies will not scale your fleet above this value. For example, in a single-session scenario, if you set the maximum capacity for a fleet to 10, your fleet will never have more than 10 instances. Similarly, in a multi-session scenario, with maximum number of sessions on an instance set to 5, if you set the maximum capacity for a fleet to 52, your fleet will never have more than roundup (52/5) = 11 instances.

**Desired Capacity**  
The total number of instances (for single session fleets) or user sessions (for multi-session fleets) that are either running or pending. This value represents the total number of concurrent streaming sessions that your fleet can support in a steady state. To set the value for **Desired Capacity**, edit **Fleet Details**. We do not recommend changing the **Desired Capacity** value manually when you use **Scaling Policies**.   
If the value of **Desired Capacity** is set below the value of **Minimum Capacity** and a scale-out activity is triggered, Application Auto Scaling scales the **Desired Capacity** value up to the value of **Minimum Capacity** and then continues to scale out as required, based on the scaling policy. However, in this case, a scale-in activity does not adjust **Desired Capacity**, because it is already below the **Minimum Capacity** value.   
If the value of **Desired Capacity** is set above the value of **Maximum Capacity** and a scale-in activity is triggered, Application Auto Scaling scales the **Desired Capacity** value down to the value of **Maximum Capacity** and then continues to scale in as required, based on the scaling policy. However, in this case, a scale-out activity does not adjust **Desired Capacity**, because it is already above the **Maximum Capacity** value.

**Scaling Policy Action**  
The action that scaling policies perform on your fleet when the **Scaling Policy Condition** is met. You can choose an action based on **% capacity** or **number of instance(s)** (for single session fleets) or **user sessions** (for multi-session fleets). For example, if **Current Capacity** is 4 and **Scaling Policy Action** is set to "Add 25% capacity", **Desired Capacity** is increased will be set to 5 when **Scaling Policy Condition** is met.

**Scaling Policy Condition**  
The condition that triggers the action set in **Scaling Policy Action**. This condition includes a scaling policy metric, a comparison operator, and a threshold. For example, to scale a fleet if the utilization of the fleet is greater than 50%, your scaling policy condition should be "If Capacity Utilization > 50%".

**Scaling Policy Metric**  
Your scaling policy is based on this metric. The following metrics are available for scaling policies:    
**Capacity Utilization**  
The percentage of instances in a fleet that are being used. You can use this metric to scale your fleet based on usage of the fleet. For example, **Scaling Policy Condition**: "If Capacity Utilization < 25%" perform **Scaling Policy Action**: "Remove 25 % capacity".  
**Available Capacity**  
The number of instances (for single session fleets) or user sessions (for multi-session fleets) in your fleet that are available for users. You can use this metric to maintain a buffer in your capacity available for users to start streaming sessions. For example, **Scaling Policy Condition**: "If Available Capacity < 5" perform **Scaling Policy Action**: "Add 5 instance(s) (for single session fleets) or user session(s) (for multi-session fleets)".  
**Insufficient Capacity Error**  
The number of session requests rejected due to lack of capacity. You can use this metric to provision new instances for users who can't start streaming sessions due to lack of capacity. For example, **Scaling Policy Condition**: "If Insufficient Capacity Error > 0" perform **Scaling Policy Action**: "Add 1 instance(s) (fr single session fleets) or user session(s) (for multi-session fleets)".

# Managing Fleet Scaling Using the Amazon WorkSpaces Applications Console
<a name="autoscaling-console"></a>

You can set up and manage fleet scaling by using the WorkSpaces Applications console in either of the following two ways: During fleet creation, or any time, by using the **Fleets** tab. Two default scaling policies are associated with newly created fleets after launch. You can edit these policies on the **Scaling Policies** tab in the WorkSpaces Applications console. For more information, see [Create a Fleet in Amazon WorkSpaces Applications](set-up-stacks-fleets-create.md).

For user environments that vary in number, define scaling policies to control how scaling responds to demand. If you expect a fixed number of users or have other reasons for disabling scaling, you can set your fleet with a fixed number of instances ro user sessions.

**To set a fleet scaling policy using the console**

1. Open the WorkSpaces Applications console at [https://console.aws.amazon.com/appstream2/home](https://console.aws.amazon.com/appstream2/home).

1. In the navigation pane, choose **Fleets**. 

1. Select the fleet and then choose **Scaling Policies**.

1. Edit existing policies by choosing the edit icon next to each value. Set the desired values in the edit field and choose **Update**. The policy changes go into effect within a few minutes.

1. Add (create) new policies using the **Add Policy** link. Set the desired values in the edit field and choose **Create**. The new policy goes into effect within a few minutes.

You can use the **Fleet Usage** tab to monitor the effects of your scaling policy changes. The following is an example usage graph of scaling activity when five users connect to the fleet and then disconnect. This example is from a fleet using the following scaling policy values:
+ Minimum Capacity = 10
+ Maximum Capacity = 50
+ Scale Out = Add 5 instances (for single session fleets) or user sessions (for multi-session fleets) if Capacity Utilization > 75%
+ Scale In = Remove 6 instances (for single session fleets) or user sessions (for multi-session fleets) if Capacity Utilization < 25%
**Note**  
The above policy is applicable in both single-session and multi-session scenarios. In a single session scenario, 5 new instances will be launched during a scale out event, and 4 instances will be reclaimed during the scale down event. In a multi-session scenario, with the maximum sessions per instance = 4, the scale out event will trigger a launch of roundup (add 5 user sessions/ maximum sessions per instance 4) = 2 instances. During a scale in event, services will reclaim roundup (remove 6 user sessions/maximum sessions per instance 4) = 2 instances. Instances with running user sessions will not be reclaimed. Only instances with no user sessions running will be reclaimed. 

**To set a fixed capacity fleet using the console**

1. Open the WorkSpaces Applications console at [https://console.aws.amazon.com/appstream2/home](https://console.aws.amazon.com/appstream2/home).

1. In the navigation pane, choose **Fleets**.

1. Select the fleet.

1. For **Scaling Policies**, remove all policies associated with the fleet.

1. For **Fleet Details**, edit the fleet to set **Desired Capacity**.

The fixed fleet has constant capacity based on the value that you specified as **Desired Capacity**. Note that a fixed fleet has the desired number of instances available at all times and the fleet must be stopped to stop billing costs for that fleet.

# Managing Fleet Scaling Using the AWS CLI for Amazon WorkSpaces Applications
<a name="autoscaling-cli"></a>

You can set up and manage fleet scaling by using the AWS Command Line Interface (AWS CLI). For more advanced features such as setting up multiple scaling policies or setting scale-in and scale-out cooldown times, use the AWS CLI. Before running scaling policy commands, you must register your fleet as a scalable target. To do so, use the following [register-scalable-target](https://docs.aws.amazon.com/cli/latest/reference/application-autoscaling/register-scalable-target.html) command:

```
aws application-autoscaling register-scalable-target
  --service-namespace appstream \
  --resource-id fleet/fleetname \
  --scalable-dimension appstream:fleet:DesiredCapacity \
  --min-capacity 1 --max-capacity 5
```

**Topics**
+ [Example 1: Applying a Scaling Policy Based on Capacity Utilization](#autoscaling-cli-utilization)
+ [Example 2: Applying a Scaling Policy Based on Insufficient Capacity Errors](#autoscaling-cli-capacity)
+ [Example 3: Applying a Scaling Policy Based on Low Capacity Utilization](#autoscaling-cli-scale-in)
+ [Example 4: Change the Fleet Capacity Based on a Schedule](#autoscaling-cli-schedule)
+ [Example 5: Applying a Target Tracking Scaling Policy](#autoscaling-target-tracking)

## Example 1: Applying a Scaling Policy Based on Capacity Utilization
<a name="autoscaling-cli-utilization"></a>

This AWS CLI example sets up a scaling policy that scales out a fleet by 25% if Utilization >= 75%.

The following [put-scaling-policy](https://docs.aws.amazon.com/cli/latest/reference/application-autoscaling/put-scaling-policy.html) command defines a utilization-based scaling policy:

```
aws application-autoscaling put-scaling-policy --cli-input-json file://scale-out-utilization.json
```

The contents of the file `scale-out-utilization.json` are as follows:

```
{
    "PolicyName": "policyname",
    "ServiceNamespace": "appstream",
    "ResourceId": "fleet/fleetname",
    "ScalableDimension": "appstream:fleet:DesiredCapacity",
    "PolicyType": "StepScaling",
    "StepScalingPolicyConfiguration": {
        "AdjustmentType": "PercentChangeInCapacity",
        "StepAdjustments": [
            {
                "MetricIntervalLowerBound": 0,
                "ScalingAdjustment": 25
            }
        ],
        "Cooldown": 120
    }
}
```

If the command is successful, the output is similar to the following, although some details are unique to your account and Region. In this example, the policy identifier is `e3425d21-16f0-d701-89fb-12f98dac64af`.

```
{"PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:e3425d21-16f0-d701-89fb-12f98dac64af:resource/appstream/fleet/SampleFleetName:policyName/scale-out-utilization-policy"}
```

Now, set up a CloudWatch alarm for this policy. Use the names, Region, account number, and policy identifier that apply to you. You can use the policy ARN returned by the previous command for the `--alarm-actions` parameter.

```
aws cloudwatch put-metric-alarm 
--alarm-name alarmname \
--alarm-description "Alarm when Capacity Utilization exceeds 75 percent" \
--metric-name CapacityUtilization \
--namespace AWS/AppStream \
--statistic Average \
--period 300 \
--threshold 75 \
--comparison-operator GreaterThanOrEqualToThreshold \
--dimensions "Name=Fleet,Value=fleetname" \
--evaluation-periods 1 --unit Percent \
--alarm-actions "arn:aws:autoscaling:your-region-code:account-number-without-hyphens:scalingPolicy:policyid:resource/appstream/fleet/fleetname:policyName/policyname"
```

## Example 2: Applying a Scaling Policy Based on Insufficient Capacity Errors
<a name="autoscaling-cli-capacity"></a>

This AWS CLI example sets up a scaling policy that scales out the fleet by 1 if the fleet returns an `InsufficientCapacityError` error.

The following command defines a insufficient capacity-based scaling policy:

```
aws application-autoscaling put-scaling-policy --cli-input-json file://scale-out-capacity.json
```

The contents of the file `scale-out-capacity.json` are as follows:

```
{
    "PolicyName": "policyname",
    "ServiceNamespace": "appstream",
    "ResourceId": "fleet/fleetname",
    "ScalableDimension": "appstream:fleet:DesiredCapacity",
    "PolicyType": "StepScaling",
    "StepScalingPolicyConfiguration": {
        "AdjustmentType": "ChangeInCapacity",
        "StepAdjustments": [
            {
                "MetricIntervalLowerBound": 0,
                "ScalingAdjustment": 1
            }
        ],
        "Cooldown": 120
    }
}
```

If the command is successful, the output is similar to the following, although some details are unique to your account and Region. In this example, the policy identifier is `f4495f21-0650-470c-88e6-0f393adb64fc`.

```
{"PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:f4495f21-0650-470c-88e6-0f393adb64fc:resource/appstream/fleet/SampleFleetName:policyName/scale-out-insufficient-capacity-policy"}
```

Now, set up a CloudWatch alarm for this policy. Use the names, Region, account number, and policy identifier that apply to you. You can use the policy ARN returned by the previous command for the `--alarm-actions` parameter.

```
aws cloudwatch put-metric-alarm 
--alarm-name alarmname \
--alarm-description "Alarm when out of capacity is > 0" \
--metric-name InsufficientCapacityError \
--namespace AWS/AppStream \
--statistic Maximum \
--period 300 \
--threshold 0 \
--comparison-operator GreaterThanThreshold \
--dimensions "Name=Fleet,Value=fleetname" \
--evaluation-periods 1 --unit Count \
--alarm-actions "arn:aws:autoscaling:your-region-code:account-number-without-hyphens:scalingPolicy:policyid:resource/appstream/fleet/fleetname:policyName/policyname"
```

## Example 3: Applying a Scaling Policy Based on Low Capacity Utilization
<a name="autoscaling-cli-scale-in"></a>

This AWS CLI example sets up a scaling policy that scales in the fleet to reduce actual capacity when `CapacityUtilization` is low.

The following command defines an excess capacity-based scaling policy:

```
aws application-autoscaling put-scaling-policy --cli-input-json file://scale-in-capacity.json
```

The contents of the file `scale-in-capacity.json` are as follows:

```
{
    "PolicyName": "policyname",
    "ServiceNamespace": "appstream",
    "ResourceId": "fleet/fleetname",
    "ScalableDimension": "appstream:fleet:DesiredCapacity",
    "PolicyType": "StepScaling",
    "StepScalingPolicyConfiguration": {
        "AdjustmentType": "PercentChangeInCapacity",
        "StepAdjustments": [
            {
                "MetricIntervalUpperBound": 0,
                "ScalingAdjustment": -25
            }
        ],
        "Cooldown": 360
    }
}
```

If the command is successful, the output is similar to the following, although some details are unique to your account and Region. In this example, the policy identifier is `12ab3c4d-56789-0ef1-2345-6ghi7jk8lm90`.

```
{"PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:12ab3c4d-56789-0ef1-2345-6ghi7jk8lm90:resource/appstream/fleet/SampleFleetName:policyName/scale-in-utilization-policy"}
```

Now, set up a CloudWatch alarm for this policy. Use the names, Region, account number, and policy identifier that apply to you. You can use the policy ARN returned by the previous command for the `--alarm-actions` parameter.

```
aws cloudwatch put-metric-alarm 
--alarm-name alarmname \
--alarm-description "Alarm when Capacity Utilization is less than or equal to 25 percent" \
--metric-name CapacityUtilization \
--namespace AWS/AppStream \
--statistic Average \
--period 120 \
--threshold 25 \
--comparison-operator LessThanOrEqualToThreshold \
--dimensions "Name=Fleet,Value=fleetname" \
--evaluation-periods 10 --unit Percent \
--alarm-actions "arn:aws:autoscaling:your-region-code:account-number-without-hyphens:scalingPolicy:policyid:resource/appstream/fleet/fleetname:policyName/policyname"
```

## Example 4: Change the Fleet Capacity Based on a Schedule
<a name="autoscaling-cli-schedule"></a>

Changing your fleet capacity based on a schedule lets you scale your fleet capacity in response to predictable changes in demand. For example, at the start of a work day, you might expect a certain number of users to request streaming connections at one time. To change your fleet capacity based on a schedule, you can use the Application Auto Scaling [PutScheduledAction](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PutScheduledAction.html) API action or the [put-scheduled-action](https://docs.aws.amazon.com/cli/latest/reference/application-autoscaling/put-scheduled-action.html) AWS CLI command.

Before changing your fleet capacity, you can list your current fleet capacity by using the WorkSpaces Applications [describe-fleets](https://docs.aws.amazon.com/cli/latest/reference/appstream/describe-fleets.html) AWS CLI command.

```
aws appstream describe-fleets --name fleetname
```

The current fleet capacity will appear similar to the following output (shown in JSON format):

```
{
    {
            "ComputeCapacityStatus": {
                "Available": 1,
                "Desired": 1,
                "Running": 1,
                "InUse": 0
            },
}
```

Then, use the `put-scheduled-action` command to create a scheduled action to change your fleet capacity. For example, the following command changes the minimum capacity to 3 and the maximum capacity to 5 every day at 9:00 AM UTC.

**Note**  
For cron expressions, specify when to perform the action in UTC. For more information, see [Cron Expressions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions).

```
aws application-autoscaling put-scheduled-action --service-namespace appstream \
--resource-id fleet/fleetname \
--schedule="cron(0 9 * * ? *)" \
--scalable-target-action MinCapacity=3,MaxCapacity=5 \
--scheduled-action-name ExampleScheduledAction \
--scalable-dimension appstream:fleet:DesiredCapacity
```

To confirm that the scheduled action to change your fleet capacity was successfully created, run the [describe-scheduled-actions](https://docs.aws.amazon.com/cli/latest/reference/application-autoscaling/describe-scheduled-actions.html) command.

```
aws application-autoscaling describe-scheduled-actions --service-namespace appstream --resource-id fleet/fleetname
```

If the scheduled action was successfully created, the output appears similar to the following.

```
{
    "ScheduledActions": [
        {
            "ScalableDimension": "appstream:fleet:DesiredCapacity",
            "Schedule": "cron(0 9 * * ? *)",
            "ResourceId": "fleet/ExampleFleet",
            "CreationTime": 1518651232.886,
            "ScheduledActionARN": "<arn>",
            "ScalableTargetAction": {
                "MinCapacity": 3,
                "MaxCapacity": 5
            },
            "ScheduledActionName": "ExampleScheduledAction",
            "ServiceNamespace": "appstream"
        }
    ]
}
```

For more information, see [Scheduled Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html) in the *Application Auto Scaling User Guide*.

## Example 5: Applying a Target Tracking Scaling Policy
<a name="autoscaling-target-tracking"></a>

With target tracking scaling, you can specify a capacity utilization level for your fleet. 

When you create a target tracking scaling policy, Application Auto Scaling automatically creates and manages CloudWatch alarms that trigger the scaling policy. The scaling policy adds or removes capacity as required to keep capacity utilization at, or close to, the specified target value. To ensure application availability, your fleet scales out proportionally to the metric as fast as it can but scales in more gradually.

The following [put-scaling-policy](https://docs.aws.amazon.com/cli/latest/reference/application-autoscaling/put-scaling-policy.html) command defines a target tracking scaling policy that attempts to maintain 75% capacity utilization for an WorkSpaces Applications fleet.

```
aws application-autoscaling put-scaling-policy --cli-input-json file://config.json
```

The contents of the file `config.json` are as follows:

```
{
  "PolicyName":"target-tracking-scaling-policy",
  "ServiceNamespace":"appstream",
  "ResourceId":"fleet/fleetname",
  "ScalableDimension":"appstream:fleet:DesiredCapacity",
  "PolicyType":"TargetTrackingScaling",
  "TargetTrackingScalingPolicyConfiguration":{
    "TargetValue":75.0,
    "PredefinedMetricSpecification":{
      "PredefinedMetricType":"AppStreamAverageCapacityUtilization"
    },
    "ScaleOutCooldown":300,
    "ScaleInCooldown":300
  }
}
```

If the command is successful, the output is similar to the following, although some details are unique to your account and Region. In this example, the policy identifier is 6d8972f3-efc8-437c-92d1-6270f29a66e7.

```
{
    "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/appstream/fleet/fleetname:policyName/target-tracking-scaling-policy",
    "Alarms": [
        {
            "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-fleet/fleetname-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca",
            "AlarmName": "TargetTracking-fleet/fleetname-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca"
        },
        {
            "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-fleet/fleetname-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d",
            "AlarmName": "TargetTracking-fleet/fleetname-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d"
        }
    ]
}
```

For more information, see [Target Tracking Scaling Policies](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html) in the *Application Auto Scaling User Guide*.

# Additional Resources for Auto Scaling Amazon WorkSpaces Applications
<a name="autoscaling-additional-resources"></a>

For step-by-step guidance for working with WorkSpaces Applications Fleet Auto Scaling, see [Scaling Your Desktop Application Streams with Amazon AppStream 2.0](https://aws.amazon.com/blogs/compute/scaling-your-desktop-application-streams-with-amazon-appstream-2-0/) in the *AWS Compute Blog*.

To learn more about using the Application Auto Scaling AWS CLI commands or API actions, see the following resources:
+ [application-autoscaling](https://docs.aws.amazon.com/cli/latest/reference/application-autoscaling) section of the *AWS CLI Command Reference*
+ [Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/)
+ [Application Auto Scaling User Guide](https://docs.aws.amazon.com/autoscaling/application/userguide/)

# Multi-Session Recommendations
<a name="multi-session-recs"></a>

When deciding the maximum number of user sessions on an instance in a multi-session environment, you should consider several factors to ensure optimal performance and streaming experience. The following are recommendations for you to determine the optimum number of user sessions on an instance:
+ *Evaluate resource requirements*: Understand the resource requirements of the applications being used within the sessions. Consider factors such as CPU, memory, disk I/O, and network bandwidth. This evaluation will help determine the amount of resources each user session typically requires.
+ *Consider instance specifications*: Take into account the specifications of the instance, including the number of CPUs, available memory, and GPU specifications. Instances with higher specifications can handle a larger number of user sessions. For more information on different instance types supported by WorkSpaces Applications and pricing, see [WorkSpaces Applications pricing](https://aws.amazon.com/appstream2/pricing/).
+ *Performance testing*: Conduct performance testing on the applications and workload expected to run within the user sessions. Measure resource utilization, response times, and overall system performance. Use this data to assess the impact of concurrent user sessions on performance, and determine the optimal session-to-instance ratio. You can run these assessments across different instance types offered by WorkSpaces Applications to find the optimal instance type or size for your end users. For more information on different instance types offered by WorkSpaces Applications, see [WorkSpaces Applications Instance Families](instance-types.md).
+ *Monitor resource utilization*: Continuously monitor the resource utilization of the instance during normal usage. Observe CPU, memory, and disk utilization. Ensure that the resource utilization remains within acceptable limits to avoid performance degradation. For a multi-session environment, you can view these metrics on WorkSpaces Applications and the CloudWatch console. For more information, see [Monitoring Amazon WorkSpaces Applications Resources](monitoring.md).
+ *Consider user behavior patterns*: Analyze user behavior patterns to understand peak usage periods and potential concurrent usage. Some users might have intermittent or sporadic usage patterns, while others might have consistent usage throughout the day. Account for these patterns when determining the maximum number of user sessions to avoid resource contention during peak periods.

  WorkSpaces Applications enables you to configure a maximum of 50 user sessions per instance, regardless of the instance type or size that you choose. However, this is just an upper limit, and not a recommended limit. The following is an example table to help you determine the maximum number of user sessions on an instance in a multi-session fleet. The recommended maximum number of users listed in the table is based on general guidelines and assumptions. Testing with the real-life workload is crucial, since actual performance can vary, depending on the workload's individual characteristics, the application's resource requirements, and user behavior.


**Recommendations based on workload types**  

| End User Category | Workload Type | Example Users | Use Cases | Recommended Configuration(s) | 
| --- | --- | --- | --- | --- | 
| End users who conduct a single task and use minimal applications | Light | Task workers, Front desk users | Data entry applications, Text editing, Bastion host | 4 users per vCPU on Stream.standard.xlarge/2xlarge or Stream.compute.xlarge\$1 or Stream.memory.xlarge\$1  | 
| End users who conduct a single task and use minimal applications | Light to Medium | Task workers, Front desk users, Contact center employees | Data entry applications, Text editing, Bastion host, Chat, Email, Messaging apps | 2 users per vCPU on Stream.standard.xlarge/2xlarge or Stream.compute.xlarge\$1 or Stream.memory.xlarge\$1 | 
| End users who create complex spreadsheets, presentations, and large documents | Medium | Task workers, Contact center employees, Business analysts | Data entry applications, Chat, Email, Messaging apps, Productivity apps | 2 users per vCPU on Stream.memory.xlarge\$1 or Stream.compute.xlarge\$1 | 
| End users with high performance workloads | Medium to Heavy | Knowledge workers, Software developers, Business intelligence analysts | Software Scripting | 1 user per vCPU on Stream.memory.xlarge\$1 or Stream.compute.xlarge\$1 | 
| End users with high performance workloads | Heavy | Knowledge workers, Software developers, Data scientists | Screen sharing, Data analytics, Audio conferencing | 1 user per 2 vCPUs on Stream.memory.xlarge\$1 or Stream.compute.xlarge\$1 | 
| End users with workloads that require graphics and heavy compute/memory resources | Heavy to Accelerated | Graphics/Architecture designers, CAD/CAM users | Audio conferencing, Graphics-intensive applications, such as remote graphics workstations | 1 user per 2 vCPUs Graphics.g4dn.\$1 | 
| End users with workloads that require graphics and heavy compute/memory resources | Accelerated | Video editors, Gamers and game developers, Data miners, GIS data engineers, AI scientists | Audio conferencing, Video transcoding and 3D rendering, Photo-realistic design, Graphics workstations, ML model training, ML inference | 1 user per 2 vCPUs Graphics.G5.\$1 | 