

# App Block Builder
<a name="app-block-builder"></a>

An app block builder is a reusable resource that you can use to package your applications (or app block). You can also use it to test your application package before associating your application to an Elastic fleet. A single app block builder can be used to create and test multiple app blocks one by one. Each time a streaming session is created for app block builder for creating or testing an app block, a new instance is created and used. After the app block builder instance is terminated, the state of the instance is not persisted. 

WorkSpaces Applications Elastic fleets use Amazon EC2 instances to stream applications. You must provide your application package and associate it with your fleet. To create your own custom application packaging, connect to an app block builder instance, and then install and configure your applications for streaming. App block builder creates the packaging for your application and uploads it to an Amazon S3 bucket in your AWS account. 

When you create an app block builder, you choose the following:
+ An instance type — WorkSpaces Applications provides different instance sizes with various CPU and memory configurations. The instance type must align with the instance family you need. 
+ The VPC, subnets, and security groups to use — Make sure that the subnets and security groups provide access to the network resources that your applications require. Typical network resources required by applications might include licensing servers, database servers, file servers, and application servers. App block builder uploads the application package on to an Amazon S3 bucket in your AWS account. The VPC you choose for your fleet must provide sufficient network access to the Amazon S3 bucket. For more information, see [Store Application Icon, Setup Script, Session Script, and VHD in an S3 Bucket](store-s3-bucket.md).

**Topics**
+ [Create an App Block Builder](create-app-block-builder.md)
+ [Connect to an App Block Builder in Amazon WorkSpaces Applications](connect-app-block-builder.md)
+ [App Block Builder Actions](app-block-builder-actions.md)

# Create an App Block Builder
<a name="create-app-block-builder"></a>

You can use app block builder instance to create your application package for WorkSpaces Applications Elastic fleets.

**To create an app block builder**

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

1. Choose **Applications Manager** in the left navigation pane, then choose the **App block builders** tab and **Create app block builder**.

1. For **Step 1: Configure app block builder**, configure the app block builder by providing the following details: 
   + **Name**: Type a unique name identifier for the app block builder.
   + **Display name (optional)**: Type a name to display for the app block builder (maximum of 100 characters).
   + **Operating system**: Select an operating system for your application. This must align with the operating system that you are going to select for you elastic fleet, which your end users will use to stream the application. 
   + **IAM role (Optional)**: When you apply an IAM role from your account to an WorkSpaces Applications app block builder, you can make AWS API requests from the app block builder instance without manually managing AWS credentials. To apply an IAM role to the app block builder, do either of the following:
     + To use an existing IAM role in your Amazon Web Services account, choose the role that you want to use from the **IAM role** list. The role must must be accessible from the image builder. 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).
   + **Instance Type**: Select the instance type for the app block builder. Choose a type that matches the performance requirements of the applications that you plan to install. 
   + **Tags (optional)**: 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).

1. Choose **Next**.

1. For **Step 2: Configure Network**, do the following:
   + To add internet access for the app block builder 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).
   + For **VPC** and **Subnet 1**, choose a VPC and at least two subnets. For increased fault tolerance, we recommend that you choose three 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).

     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 image builder. 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 **VPC Endpoints (Optional)**, you can create an interface VPC endpoint (interface endpoint) in your virtual private cloud (VPC). To create the interface endpoint, choose **Create VPC Endpoint**. Selecting this link opens the VPC console. To finish creating the endpoint, follow steps 3 through 6 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.

1. Choose **Next**.

1. Choose **Review** and confirm the details for the app block builder. To change the configuration for any section, choose **Edit** and make the needed changes.

1. After you finish reviewing the configuration details, choose **Create app block builder**.
**Note**  
If an error message notifies you that you don't have sufficient limits (quotas) to create the image builder, 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*.

# Connect to an App Block Builder in Amazon WorkSpaces Applications
<a name="connect-app-block-builder"></a>

You can connect to an app block builder by doing either of the following: 
+ Using the WorkSpaces Applications console (for browser connections only)
+ Creating a streaming URL (for browser or WorkSpaces Applications client connections)

**Note**  
App block builder doesn’t support Active Directory domain join. 

**Topics**
+ [Amazon WorkSpaces Applications Console (Browser Connection)](connect-app-block-builder-console.md)
+ [Streaming URL (Amazon WorkSpaces Applications Client or Browser Connection)](connect-app-block-builder-streaming.md)

# Amazon WorkSpaces Applications Console (Browser Connection)
<a name="connect-app-block-builder-console"></a>

To use the WorkSpaces Applications console to connect to an app block builder through a browser, complete the following steps.

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

1. In the left navigation pane, choose **Applications Manager**, and then choose **App block builders**.

1. In the list of app block builders, choose the app block builder to which you want to connect. Verify that the status of the app block builder is **Running**, and choose **Connect**.

   For this step to work, you might need to configure your browser to allow pop-ups from https://stream.<aws-region>.amazonappstream.com/.

1. Start streaming the app block builder.

# Streaming URL (Amazon WorkSpaces Applications Client or Browser Connection)
<a name="connect-app-block-builder-streaming"></a>

You can create a streaming URL to connect to an app block builder through a browser or the WorkSpaces Applications client. Unlike a streaming URL that you create to enable user access to a fleet instance, which is valid for a maximum of seven days, by default, a streaming URL that you create to access an image builder expires after one hour. To set a different expiration time, you must generate the streaming URL by using the [CreateAppBlockBuilderStreamingURL](https://docs.aws.amazon.com/appstream2/latest/APIReference/API_CreateAppBlockBuilderStreamingURL.html) API action.

**Note**  
Streaming a URL to connect to an app block builder is not supported on the macOS client. 

You can create a streaming URL in any of the following ways:
+ WorkSpaces Applications console
+ The [CreateAppBlockBuilderStreamingURL](https://docs.aws.amazon.com/appstream2/latest/APIReference/API_CreateAppBlockBuilderStreamingURL.html) API action 
+ The [create-app-block-builder-streaming-url](https://docs.aws.amazon.com/cli/latest/reference/appstream/create-app-block-builder-streaming-url.html) AWS CLI command

To create a streaming URL and connect to the app block builder by using the WorkSpaces Applications console, complete the steps in the following procedure.

**To create a streaming URL and connect to the app block builder by using the WorkSpaces Applications 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 **Application Manager**, **App block builders**.

1. In the list of app block builders, choose the app block builder to which you want to connect. Verify that the status of the app block builder is **Running**.

1. Choose **Actions**, **Create streaming URL**.

1. Do one of the following:
   + To save the streaming URL to connect to the app block builder later, choose **Copy Link** to copy the URL, then save it to an accessible location.
   + To connect to the app block builder through the WorkSpaces Applications client, choose **Launch in Client**. When you choose this option, the WorkSpaces Applications client sign-in page is prepopulated with the streaming URL.
   + To connect to the app block builder through a browser, choose **Launch in Browser**. When you choose this option, a browser opens with the address bar prepopulated with the streaming URL.

1. After you create the streaming URL and connect to the app block builder, start streaming the app block builder.

# App Block Builder Actions
<a name="app-block-builder-actions"></a>

You can perform the following actions on an app block builder, depending on the current state (status) of the app block builder instance.

**Delete**  
Permanently delete an app block builder.   
The instance must be in a **Stopped** state.

**Connect**  
Connect to a running app block builder. This action starts a desktop streaming session with the app block builder to install and add applications, and create an app block.   
The instance must be in a **Running** state.

**Start**  
Start a stopped app block builder. A running instance is billed to your account.  
The instance must be in a **Stopped** state, and associated with an app block.

**Stop**  
Stop a running app block builder. A stopped instance is not billed to your account.   
The instance must be in a **Running** state.

**Update**  
Update any of the app block builder properties, except the name.  
The instance must be in a **Stopped** state.

None of these actions can be performed on an instance in any of the following intermediate states:
+ **Pending**
+ **Stopping**
+ **Starting**
+ **Deleting**