:doc:`AppStream <../../appstream>` / Client / create_export_image_task

************************
create_export_image_task
************************



.. py:method:: AppStream.Client.create_export_image_task(**kwargs)

  

  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.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateExportImageTask>`_  


  **Request Syntax**
  ::

    response = client.create_export_image_task(
        ImageName='string',
        AmiName='string',
        IamRoleArn='string',
        TagSpecifications={
            'string': 'string'
        },
        AmiDescription='string'
    )
    
  :type ImageName: string
  :param ImageName: **[REQUIRED]** 

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

    

  
  :type AmiName: string
  :param AmiName: **[REQUIRED]** 

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

    

  
  :type IamRoleArn: string
  :param IamRoleArn: **[REQUIRED]** 

    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 TagSpecifications: dict
  :param TagSpecifications: 

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

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  :type AmiDescription: string
  :param AmiDescription: 

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

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ExportImageTask': {
              'TaskId': 'string',
              'ImageArn': 'string',
              'AmiName': 'string',
              'CreatedDate': datetime(2015, 1, 1),
              'AmiDescription': 'string',
              'State': 'EXPORTING'|'COMPLETED'|'FAILED',
              'AmiId': 'string',
              'TagSpecifications': {
                  'string': 'string'
              },
              'ErrorDetails': [
                  {
                      'ErrorCode': 'string',
                      'ErrorMessage': 'string'
                  },
              ]
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ExportImageTask** *(dict) --* 

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

        
        

        - **TaskId** *(string) --* 

          The unique identifier for the export image task. Use this ID to track the task's progress and retrieve its details.

          
        

        - **ImageArn** *(string) --* 

          The ARN of the WorkSpaces Applications image being exported.

          
        

        - **AmiName** *(string) --* 

          The name of the EC2 AMI that will be created by this export task.

          
        

        - **CreatedDate** *(datetime) --* 

          The date and time when the export image task was created.

          
        

        - **AmiDescription** *(string) --* 

          The description that will be applied to the exported EC2 AMI.

          
        

        - **State** *(string) --* 

          The current state of the export image task, such as PENDING, RUNNING, COMPLETED, or FAILED.

          
        

        - **AmiId** *(string) --* 

          The ID of the EC2 AMI that was created by this export task. This field is only populated when the task completes successfully.

          
        

        - **TagSpecifications** *(dict) --* 

          The tags that will be applied to the exported EC2 AMI.

          
          

          - *(string) --* 
            

            - *(string) --* 
      
    
        

        - **ErrorDetails** *(list) --* 

          Details about any errors that occurred during the export process. This field is only populated when the task fails.

          
          

          - *(dict) --* 

            The error details.

            
            

            - **ErrorCode** *(string) --* 

              The error code.

              
            

            - **ErrorMessage** *(string) --* 

              The error message.

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`AppStream.Client.exceptions.LimitExceededException`

  
  *   :py:class:`AppStream.Client.exceptions.InvalidRoleException`

  
  *   :py:class:`AppStream.Client.exceptions.InvalidAccountStatusException`

  
  *   :py:class:`AppStream.Client.exceptions.OperationNotPermittedException`

  
  *   :py:class:`AppStream.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`AppStream.Client.exceptions.ConcurrentModificationException`

  
  *   :py:class:`AppStream.Client.exceptions.ResourceNotAvailableException`

  