CreateExportImageTask - Amazon WorkSpaces Applications

CreateExportImageTask

Creates a task to export a WorkSpaces Applications image to an EC2 AMI. This allows you to use your customized WorkSpaces Applications images with other AWS services or for backup purposes.

Request Syntax

{ "AmiDescription": "string", "AmiName": "string", "IamRoleArn": "string", "ImageName": "string", "TagSpecifications": { "string" : "string" } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

AmiDescription

An optional description for the exported AMI. This description will be applied to the resulting EC2 AMI.

Type: String

Length Constraints: Maximum length of 256.

Required: No

AmiName

The name for the exported EC2 AMI. This is a required field that must be unique within your account and region.

Type: String

Pattern: ^[a-zA-Z0-9().\-/_]{3,128}$

Required: Yes

IamRoleArn

The ARN of the IAM role that allows WorkSpaces Applications to create the AMI. The role must have permissions to copy images, describe images, and create tags, with a trust relationship allowing appstream.amazonaws.com to assume the role.

Type: String

Pattern: ^arn:aws(?:\-cn|\-iso\-b|\-iso|\-us\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\-]{0,1023}$

Required: Yes

ImageName

The name of the WorkSpaces Applications image to export. The image must be in an available state and owned by your account.

Type: String

Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$

Required: Yes

TagSpecifications

The tags to apply to the exported AMI. These tags help you organize and manage your EC2 AMIs.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^(^(?!aws:).[\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Value Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Required: No

Response Syntax

{ "ExportImageTask": { "AmiDescription": "string", "AmiId": "string", "AmiName": "string", "CreatedDate": number, "ErrorDetails": [ { "ErrorCode": "string", "ErrorMessage": "string" } ], "ImageArn": "string", "State": "string", "TagSpecifications": { "string" : "string" }, "TaskId": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ExportImageTask

Information about the export image task that was created, including the task ID and initial state.

Type: ExportImageTask object

Errors

For information about the errors that are common to all actions, see Common Errors.

ConcurrentModificationException

An API error occurred. Wait a few minutes and try again.

Message

The error message in the exception.

HTTP Status Code: 400

InvalidAccountStatusException

The resource cannot be created because your AWS account is suspended. For assistance, contact AWS Support.

Message

The error message in the exception.

HTTP Status Code: 400

InvalidRoleException

The specified role is invalid.

Message

The error message in the exception.

HTTP Status Code: 400

LimitExceededException

The requested limit exceeds the permitted limit for an account.

Message

The error message in the exception.

HTTP Status Code: 400

OperationNotPermittedException

The attempted operation is not permitted.

Message

The error message in the exception.

HTTP Status Code: 400

ResourceNotAvailableException

The specified resource exists and is not in use, but isn't available.

Message

The error message in the exception.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource was not found.

Message

The error message in the exception.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: