Automate the creation of AppStream 2.0 resources using AWS CloudFormation
Created by Ram Kandaswamy (AWS)
Summary
This pattern provides code samples and steps to automate the creation of Amazon AppStream 2.0 resources in the Amazon Web Services (AWS) Cloud by using an AWS CloudFormation template. The pattern shows you how to use an AWS CloudFormation stack to automate the creation of your AppStream 2.0 application resources, including an image builder, image, fleet instance, and stack. You can stream your AppStream 2.0 application to end users on an HTML5-compliant browser by using either the desktop or application delivery mode.
Prerequisites and limitations
Prerequisites
An active AWS account
An acceptance of AppStream 2.0 terms and conditions
Basic knowledge of AppStream resources, such as stacks, fleets, and image builders
Limitations
You can’t modify the AWS Identity and Access Management (IAM) role associated with an AppStream 2.0 instance after that instance is created.
You can’t modify properties (such as the subnet or security group) on the AppStream 2.0 image builder instance after that image builder is created.
Architecture
The following diagram shows you how to automate the creation of AppStream 2.0 resources by using an AWS CloudFormation template.
The diagram shows the following workflow:
You create an AWS CloudFormation template based on the YAML code in the Additional information section of this pattern.
The AWS CloudFormation template creates an AWS CloudFormation test stack.
(Optional) You create an image builder instance by using AppStream 2.0.
(Optional) You create a Windows image by using your custom software.
The AWS CloudFormation stack creates an AppStream 2.0 fleet instance and stack.
You deploy your AppStream 2.0 resources to end users on an HTML5-compliant browser.
Technology stack
Amazon AppStream 2.0
AWS CloudFormation
Tools
Amazon AppStream 2.0 is a fully managed application streaming service that provides you with instant access to your desktop applications from anywhere. AppStream 2.0 manages the AWS resources required to host and run your applications, scales automatically, and provides access to your users on demand.
AWS CloudFormation helps you model and set up your AWS resources, provision them quickly and consistently, and manage them throughout their lifecycle. You can use a template to describe your resources and their dependencies, and launch and configure them together as a stack, instead of managing resources individually. You can manage and provision stacks across multiple AWS accounts and AWS Regions.
Epics
Task | Description | Skills required |
---|---|---|
Install custom software and create an image. |
Note: Consider using the Windows AppLocker feature to further lock down the image. | AWS DevOps, Cloud architect |
Task | Description | Skills required |
---|---|---|
Update the AWS CloudFormation template. |
| AWS systems administrator, Cloud administrator, Cloud architect, General AWS, AWS administrator |
Create an AWS CloudFormation stack using the template. |
| App owner, AWS systems administrator, Windows Engineer |
Related resources
References
Tutorials and videos
Additional information
The following code is an example of an AWS CloudFormation template that allows you to automatically create AppStream 2.0 resources.
AWSTemplateFormatVersion: 2010-09-09 Parameters: SubnetIds: Type: 'List<AWS::EC2::Subnet::Id>' testSecurityGroup: Type: 'AWS::EC2::SecurityGroup::Id' ImageName: Type: String Resources: AppStreamFleet: Type: 'AWS::AppStream::Fleet' Properties: ComputeCapacity: DesiredInstances: 5 InstanceType: stream.standard.medium Name: appstream-test-fleet DisconnectTimeoutInSeconds: 1200 FleetType: ON_DEMAND IdleDisconnectTimeoutInSeconds: 1200 ImageName: !Ref ImageName MaxUserDurationInSeconds: 345600 VpcConfig: SecurityGroupIds: - !Ref testSecurityGroup SubnetIds: !Ref SubnetIds AppStreamStack: Type: 'AWS::AppStream::Stack' Properties: Description: AppStream stack for test DisplayName: AppStream test Stack Name: appstream-test-stack StorageConnectors: - ConnectorType: HOMEFOLDERS UserSettings: - Action: CLIPBOARD_COPY_FROM_LOCAL_DEVICE Permission: ENABLED - Action: CLIPBOARD_COPY_TO_LOCAL_DEVICE Permission: ENABLED - Action: FILE_DOWNLOAD Permission: ENABLED - Action: PRINTING_TO_LOCAL_DEVICE Permission: ENABLED AppStreamFleetAssociation: Type: 'AWS::AppStream::StackFleetAssociation' Properties: FleetName: appstream-test-fleet StackName: appstream-test-stack DependsOn: - AppStreamFleet - AppStreamStack