- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateImageBuilderCommand
Creates an image builder. An image builder is a virtual machine that is used to create an image.
The initial state of the builder is PENDING
. When it is ready, the state is RUNNING
.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { AppStreamClient, CreateImageBuilderCommand } from "@aws-sdk/client-appstream"; // ES Modules import
// const { AppStreamClient, CreateImageBuilderCommand } = require("@aws-sdk/client-appstream"); // CommonJS import
const client = new AppStreamClient(config);
const input = { // CreateImageBuilderRequest
Name: "STRING_VALUE", // required
ImageName: "STRING_VALUE",
ImageArn: "STRING_VALUE",
InstanceType: "STRING_VALUE", // required
Description: "STRING_VALUE",
DisplayName: "STRING_VALUE",
VpcConfig: { // VpcConfig
SubnetIds: [ // SubnetIdList
"STRING_VALUE",
],
SecurityGroupIds: [ // SecurityGroupIdList
"STRING_VALUE",
],
},
IamRoleArn: "STRING_VALUE",
EnableDefaultInternetAccess: true || false,
DomainJoinInfo: { // DomainJoinInfo
DirectoryName: "STRING_VALUE",
OrganizationalUnitDistinguishedName: "STRING_VALUE",
},
AppstreamAgentVersion: "STRING_VALUE",
Tags: { // Tags
"<keys>": "STRING_VALUE",
},
AccessEndpoints: [ // AccessEndpointList
{ // AccessEndpoint
EndpointType: "STREAMING", // required
VpceId: "STRING_VALUE",
},
],
};
const command = new CreateImageBuilderCommand(input);
const response = await client.send(command);
// { // CreateImageBuilderResult
// ImageBuilder: { // ImageBuilder
// Name: "STRING_VALUE", // required
// Arn: "STRING_VALUE",
// ImageArn: "STRING_VALUE",
// Description: "STRING_VALUE",
// DisplayName: "STRING_VALUE",
// VpcConfig: { // VpcConfig
// SubnetIds: [ // SubnetIdList
// "STRING_VALUE",
// ],
// SecurityGroupIds: [ // SecurityGroupIdList
// "STRING_VALUE",
// ],
// },
// InstanceType: "STRING_VALUE",
// Platform: "WINDOWS" || "WINDOWS_SERVER_2016" || "WINDOWS_SERVER_2019" || "WINDOWS_SERVER_2022" || "AMAZON_LINUX2" || "RHEL8" || "ROCKY_LINUX8",
// IamRoleArn: "STRING_VALUE",
// State: "PENDING" || "UPDATING_AGENT" || "RUNNING" || "STOPPING" || "STOPPED" || "REBOOTING" || "SNAPSHOTTING" || "DELETING" || "FAILED" || "UPDATING" || "PENDING_QUALIFICATION",
// StateChangeReason: { // ImageBuilderStateChangeReason
// Code: "INTERNAL_ERROR" || "IMAGE_UNAVAILABLE",
// Message: "STRING_VALUE",
// },
// CreatedTime: new Date("TIMESTAMP"),
// EnableDefaultInternetAccess: true || false,
// DomainJoinInfo: { // DomainJoinInfo
// DirectoryName: "STRING_VALUE",
// OrganizationalUnitDistinguishedName: "STRING_VALUE",
// },
// NetworkAccessConfiguration: { // NetworkAccessConfiguration
// EniPrivateIpAddress: "STRING_VALUE",
// EniId: "STRING_VALUE",
// },
// ImageBuilderErrors: [ // ResourceErrors
// { // ResourceError
// ErrorCode: "IAM_SERVICE_ROLE_MISSING_ENI_DESCRIBE_ACTION" || "IAM_SERVICE_ROLE_MISSING_ENI_CREATE_ACTION" || "IAM_SERVICE_ROLE_MISSING_ENI_DELETE_ACTION" || "NETWORK_INTERFACE_LIMIT_EXCEEDED" || "INTERNAL_SERVICE_ERROR" || "IAM_SERVICE_ROLE_IS_MISSING" || "MACHINE_ROLE_IS_MISSING" || "STS_DISABLED_IN_REGION" || "SUBNET_HAS_INSUFFICIENT_IP_ADDRESSES" || "IAM_SERVICE_ROLE_MISSING_DESCRIBE_SUBNET_ACTION" || "SUBNET_NOT_FOUND" || "IMAGE_NOT_FOUND" || "INVALID_SUBNET_CONFIGURATION" || "SECURITY_GROUPS_NOT_FOUND" || "IGW_NOT_ATTACHED" || "IAM_SERVICE_ROLE_MISSING_DESCRIBE_SECURITY_GROUPS_ACTION" || "FLEET_STOPPED" || "FLEET_INSTANCE_PROVISIONING_FAILURE" || "DOMAIN_JOIN_ERROR_FILE_NOT_FOUND" || "DOMAIN_JOIN_ERROR_ACCESS_DENIED" || "DOMAIN_JOIN_ERROR_LOGON_FAILURE" || "DOMAIN_JOIN_ERROR_INVALID_PARAMETER" || "DOMAIN_JOIN_ERROR_MORE_DATA" || "DOMAIN_JOIN_ERROR_NO_SUCH_DOMAIN" || "DOMAIN_JOIN_ERROR_NOT_SUPPORTED" || "DOMAIN_JOIN_NERR_INVALID_WORKGROUP_NAME" || "DOMAIN_JOIN_NERR_WORKSTATION_NOT_STARTED" || "DOMAIN_JOIN_ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED" || "DOMAIN_JOIN_NERR_PASSWORD_EXPIRED" || "DOMAIN_JOIN_INTERNAL_SERVICE_ERROR",
// ErrorMessage: "STRING_VALUE",
// ErrorTimestamp: new Date("TIMESTAMP"),
// },
// ],
// AppstreamAgentVersion: "STRING_VALUE",
// AccessEndpoints: [ // AccessEndpointList
// { // AccessEndpoint
// EndpointType: "STREAMING", // required
// VpceId: "STRING_VALUE",
// },
// ],
// LatestAppstreamAgentVersion: "TRUE" || "FALSE",
// },
// };
CreateImageBuilderCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
InstanceType Required | string | undefined | The instance type to use when launching the image builder. The following instance types are available:
|
Name Required | string | undefined | A unique name for the image builder. |
AccessEndpoints | AccessEndpoint[] | undefined | The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the image builder only through the specified endpoints. |
AppstreamAgentVersion | string | undefined | The version of the AppStream 2.0 agent to use for this image builder. To use the latest version of the AppStream 2.0 agent, specify [LATEST]. |
Description | string | undefined | The description to display. |
DisplayName | string | undefined | The image builder name to display. |
DomainJoinInfo | DomainJoinInfo | undefined | The name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain. |
EnableDefaultInternetAccess | boolean | undefined | Enables or disables default internet access for the image builder. |
IamRoleArn | string | undefined | The Amazon Resource Name (ARN) of the IAM role to apply to the image builder. To assume a role, the image builder calls the AWS Security Token Service (STS) For more information, see Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 Administration Guide. |
ImageArn | string | undefined | The ARN of the public, private, or shared image to use. |
ImageName | string | undefined | The name of the image used to create the image builder. |
Tags | Record<string, string> | undefined | The tags to associate with the image builder. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters: _ . : / = + - If you do not specify a value, the value is set to an empty string. For more information about tags, see Tagging Your Resources in the Amazon AppStream 2.0 Administration Guide. |
VpcConfig | VpcConfig | undefined | The VPC configuration for the image builder. You can specify only one subnet. |
CreateImageBuilderCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ImageBuilder | ImageBuilder | undefined | Information about the image builder. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ConcurrentModificationException | client | An API error occurred. Wait a few minutes and try again. |
IncompatibleImageException | client | The image can't be updated because it's not compatible for updates. |
InvalidAccountStatusException | client | The resource cannot be created because your AWS account is suspended. For assistance, contact AWS Support. |
InvalidParameterCombinationException | client | Indicates an incorrect combination of parameters, or a missing parameter. |
InvalidRoleException | client | The specified role is invalid. |
LimitExceededException | client | The requested limit exceeds the permitted limit for an account. |
OperationNotPermittedException | client | The attempted operation is not permitted. |
RequestLimitExceededException | client | AppStream 2.0 can’t process the request right now because the Describe calls from your AWS account are being throttled by Amazon EC2. Try again later. |
ResourceAlreadyExistsException | client | The specified resource already exists. |
ResourceNotAvailableException | client | The specified resource exists and is not in use, but isn't available. |
ResourceNotFoundException | client | The specified resource was not found. |
AppStreamServiceException | Base exception class for all service exceptions from AppStream service. |