Introduction to AWS Appstream 2.0 and steps to configure Appstream service
Tags: awsappstream, aws, appdelivery
Published: 2023-02-08 15:32:42

AWS Appstream 2.0 is a fully managed App streaming service from AWS which allows users to stream the business applications from any device. Consider AWS Appstream as an alternative solution for Citrix XenApp. You pay for the resources you use and a small license fee(~$5) for the Remote desktop CAL.

A generic question which comes to mind is does Appstream supports multiple users/Appstream server?.The answer is NO. Appstream creates 1 instance/user/stack.So if we have 100 users, appstream will create 100 instances.

## Appstream Architecture
![AWS Architecture](https://d2908q01vomqb2.cloudfront.net/fc074d501302eb2b93e2554793fcaf50b3bf7291/2020/05/07/AppStream-2.0-can-be-managed-through-the-AWS-SDK-1.png)
image courtesy:- AWS Blogs.
In the Appstream architecture, the fleets or app streaming servers are located and managed by AWS however it is integrated to customer aws account via the elastic network interfaces.
There are three types of Appstream fleets .
**Always ON:-**This fleet type will provide users instant-on access to their apps. You will be charged for all running instances in your fleet even if no users are streaming apps.
**OnDemand:-**on-demand fleet, users will experience a start time of about one to two minutes for their session. However, you will only be charged the streaming instance fees when users are connected, and a small hourly fee for each instance in the fleet that is not streaming apps.
**Elastic Fleets:-**elastic fleet don’t require installation and can be run from a virtual hard disk. Elastic fleets don’t support AppStream 2.0 images, nor do they require scaling policies. You are charged only for the duration of a streaming session.

Let us see how to configure Appstream to stream some of the business applications to users.

Appstream service consists of the below components: –

**Fleet:** – Collection of servers from where the Application is getting streamed

**Stack:** – A combination of Fleet plus user Policies

**Images:** – The App stream images where the streamed applications were deployed. You have options to select AWS owned Appstream images or you can create custom Appstream images with the help of Image builder.

The steps to create your custom Appstream Image will be described in a separate blog post.

**Directory Config:** – You can integrate your Appstream fleet servers into the Active directory. This is optional and your Appstream can function without corporate AD integration

**User Pools:** – The place where we can create users and assign them to stacks.
Let us take a deep dive on how to create the appstream 2.0 environment.

## CREATING FLEET
Navigate to Appstream 2.0 service and click on Fleet.
Click on “Create Fleet” to start creating the fleet.
We need to select the fleet type which we need to use. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qz7qxjhy0wsyt97mn8lt.png)

There are three kinds of AWS fleets.

**Always-on:-** Select this fleet type to provide users instant-on access to their apps. You will be charged for all running instances in your fleet even if no users are streaming apps.

**On-demand:-**Select this fleet type to optimize your streaming costs. With an on-demand fleet, users will experience a start time of about one to two minutes for their session.

**Elastic:**-Select an elastic fleet for applications that don’t require installation and can be run from a virtual hard disk.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/by44364o6e9s368l6zzk.png)
Select on-demand as the fleet type and click on next.

In the “fleet details”, Provide a name for your fleet, a display name and description.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/3.png)
In the “Choose instance type” option select the VM family for your fleet instances. For this demo, I am selecting general purpose “stream.standard.medium” which is equal to t2.medium instance size in EC2.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/4.png)
In the “User session details” select the maximum session duration, disconnect timer and idle timeout settings for users.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/5.png)
In the “fleet capacity“, select the minimum and maximum capacity for your fleet.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/6.png)
In the “stream view details“, select whether you need to publish application or a full desktop to user.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/7.png)
You can configure scale in and scale out in the “Scaling details-advanced” option.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/8.png)
Configure IAM option if your fleet need password less communication to any other AWS services.

Configure tags if needed and click on next.

In the “Choose an image” tab, select the image you need to use for your fleet servers. The image need to contain the applications which need to be streamed to the users. I am writing a dedicated blog which only talks about how to create a custom streaming image.

![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/9.png)
Once you select your image, click on next

In the configure network tab, select whether your fleet instances need internet access or not. Check the box “Enable default internet access” if you need direct internet connectivity from fleet to internet.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/10.png)
Select the VPC and subnets where you are going to deploy the fleet instances. You need to select minimum 2 subnets as the fleets will automatically load balanced across AZs.

Choose your active directory domain if configured already, else it is purely optional.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/11.png)

Click Next to review the settings and click on create to create your fleet.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/12.png)
Confirm to create the Fleet
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/13.png)
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/14.png)

## CREATING THE STACK
As I mentioned earlier, App stack is a combination of your fleet as well as user policies. Click on stack and “create stack” .
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/15.png)
In the stack details, provide the name, display name and description for your stack. You can also provide a redirect URL and feedback URL as optional. For example, you can redirect the users to your corporate SharePoint once the appstream is ended and point them to a survey URL where they can provide the feedback about the Appstream experience.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/16.png)
You can configure VPC endpoints as optional. Click on Next
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/17.png)
In the “Enable Storage” tab, you can select to map the home folder, google drive and OneDrive for business for the user session. The home folders will be configured in an S3 bucket. You can configure your G suite domain and Onedrive for business domain as well. For this demo, i am enable home folders and OneDrive for business for my test user.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/18.png)
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/19.png)
Click Next once you configure it.

In the “Edit User settings” select whether you need to redirect the user clipboard, allow file transfer between Appstream session and your local endpoint, printer redirection etc.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/20.png)
You need to select either password authentication or smart card authentication or both.

In the “Application setting persistence” , check the box to enable the app settings persistence option which is basically a roaming profile concept where your application settings will be retained to an S3 bucket.

![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/21.png)
Click Next

In the Review and Create tab, review the settings you configured and Click on “Create stack” to create your stack.

## CREATING USER POOL
User pool as the name suggest, is a place where we can create Appstream users and publish stack to user.

Click on User pools and select “Create User“
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/38.png)
Provide the email address, first name and last name and click on “Create User“
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/39.png)
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/40.png)

## EMAIL CONFIRMATION TO USER WITH USER NAME AND PASSWORD
The end user will get an email with instructions as shown in the below diagram.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/24.png)

## ACCESSING THE APPSTREAM APPS AS AN END USER
Click on the link to access the Appstream login page. provide the user name and password to access the applications.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/25.png)
I got a password change prompt and asked me to provide a new password in my first login.

Once I authenticated to the Appstream, I got a notification stating that no Application is available for the user. This error happened because I haven’t configured entitlement.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/26.png)
Click on the stack and navigate to entitlement ,and click on “Create entitlement”
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/27.png)
Provide Name, description and select attribute mapping where we can map a user type/department to publish a set of applications.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/28.png)
From the “Application settings“, select whether you need to present all applications or selected applications which will be given to the users.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/29.png)
Once the entitlement is configure, I relogged into the user portal and can view my published streamed applications.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/30.png)
Click on the application you need to open. Hence I provisioned an on-demand fleet, it took some time for my application to launch.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/31.png)
Finally my notepad++ has launched without issues.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/32.png)
I have tested clipboard copy paste from my local laptop to Appstream notepad++ application.

I opened a notepad and typed some text in my laptop.I can successfully paste the text to my Appstream session.

![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/35.png)
The usage of fleet instances can be viewed from the “fleet usage” option from your fleet.
![Image description](https://amalcloudblogs.s3.ap-southeast-1.amazonaws.com/AWS/Appstream/36.png)
Hope this blog is useful to you. You can check my blogs on VDI and Azure world. {% embed https://amalcloud.wordpress.com %}