:doc:`EC2 <../../ec2>` / Client / bundle_instance

***************
bundle_instance
***************



.. py:method:: EC2.Client.bundle_instance(**kwargs)

  

  Bundles an Amazon instance store-backed Windows instance.

   

  During bundling, only the root device volume (C:\) is bundled. Data on other instance store volumes is not preserved.

   

  .. note::

    

    This action is not applicable for Linux/Unix instances or Windows instances that are backed by Amazon EBS.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstance>`_  


  **Request Syntax**
  ::

    response = client.bundle_instance(
        InstanceId='string',
        Storage={
            'S3': {
                'AWSAccessKeyId': 'string',
                'Bucket': 'string',
                'Prefix': 'string',
                'UploadPolicy': b'bytes',
                'UploadPolicySignature': 'string'
            }
        },
        DryRun=True|False
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The ID of the instance to bundle.

     

    Default: None

    

  
  :type Storage: dict
  :param Storage: **[REQUIRED]** 

    The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

    

  
    - **S3** *(dict) --* 

      An Amazon S3 storage location.

      

    
      - **AWSAccessKeyId** *(string) --* 

        The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in `Best Practices for Amazon Web Services accounts <https://docs.aws.amazon.com/accounts/latest/reference/best-practices.html>`__ in the *Account ManagementReference Guide*.

        

      
      - **Bucket** *(string) --* 

        The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

        

      
      - **Prefix** *(string) --* 

        The beginning of the file name of the AMI.

        

      
      - **UploadPolicy** *(bytes) --* 

        An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

        

      
      - **UploadPolicySignature** *(string) --* 

        The signature of the JSON document.

        

      
    
  
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

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

    
    ::

      {
          'BundleTask': {
              'InstanceId': 'string',
              'BundleId': 'string',
              'State': 'pending'|'waiting-for-shutdown'|'bundling'|'storing'|'cancelling'|'complete'|'failed',
              'StartTime': datetime(2015, 1, 1),
              'UpdateTime': datetime(2015, 1, 1),
              'Storage': {
                  'S3': {
                      'AWSAccessKeyId': 'string',
                      'Bucket': 'string',
                      'Prefix': 'string',
                      'UploadPolicy': b'bytes',
                      'UploadPolicySignature': 'string'
                  }
              },
              'Progress': 'string',
              'BundleTaskError': {
                  'Code': 'string',
                  'Message': 'string'
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Contains the output of BundleInstance.

      
      

      - **BundleTask** *(dict) --* 

        Information about the bundle task.

        
        

        - **InstanceId** *(string) --* 

          The ID of the instance associated with this bundle task.

          
        

        - **BundleId** *(string) --* 

          The ID of the bundle task.

          
        

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

          The state of the task.

          
        

        - **StartTime** *(datetime) --* 

          The time this task started.

          
        

        - **UpdateTime** *(datetime) --* 

          The time of the most recent update for the task.

          
        

        - **Storage** *(dict) --* 

          The Amazon S3 storage locations.

          
          

          - **S3** *(dict) --* 

            An Amazon S3 storage location.

            
            

            - **AWSAccessKeyId** *(string) --* 

              The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in `Best Practices for Amazon Web Services accounts <https://docs.aws.amazon.com/accounts/latest/reference/best-practices.html>`__ in the *Account ManagementReference Guide*.

              
            

            - **Bucket** *(string) --* 

              The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

              
            

            - **Prefix** *(string) --* 

              The beginning of the file name of the AMI.

              
            

            - **UploadPolicy** *(bytes) --* 

              An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

              
            

            - **UploadPolicySignature** *(string) --* 

              The signature of the JSON document.

              
        
      
        

        - **Progress** *(string) --* 

          The level of task completion, as a percent (for example, 20%).

          
        

        - **BundleTaskError** *(dict) --* 

          If the task fails, a description of the error.

          
          

          - **Code** *(string) --* 

            The error code.

            
          

          - **Message** *(string) --* 

            The error message.

            
      
    
  