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

************************************
modify_instance_credit_specification
************************************



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

  

  Modifies the credit option for CPU usage on a running or stopped burstable performance instance. The credit options are ``standard`` and ``unlimited``.

   

  For more information, see `Burstable performance instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html>`__ in the *Amazon EC2 User Guide*.

  

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


  **Request Syntax**
  ::

    response = client.modify_instance_credit_specification(
        DryRun=True|False,
        ClientToken='string',
        InstanceCreditSpecifications=[
            {
                'InstanceId': 'string',
                'CpuCredits': 'string'
            },
        ]
    )
    
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the operation, 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``.

    

  
  :type ClientToken: string
  :param ClientToken: 

    A unique, case-sensitive token that you provide to ensure idempotency of your modification request. For more information, see `Ensuring Idempotency <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html>`__.

    

  
  :type InstanceCreditSpecifications: list
  :param InstanceCreditSpecifications: **[REQUIRED]** 

    Information about the credit option for CPU usage.

    

  
    - *(dict) --* 

      Describes the credit option for CPU usage of a burstable performance instance.

      

    
      - **InstanceId** *(string) --* **[REQUIRED]** 

        The ID of the instance.

        

      
      - **CpuCredits** *(string) --* 

        The credit option for CPU usage of the instance.

         

        Valid values: ``standard`` | ``unlimited``

         

        T3 instances with ``host`` tenancy do not support the ``unlimited`` CPU credit option.

        

      
    

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

    
    ::

      {
          'SuccessfulInstanceCreditSpecifications': [
              {
                  'InstanceId': 'string'
              },
          ],
          'UnsuccessfulInstanceCreditSpecifications': [
              {
                  'InstanceId': 'string',
                  'Error': {
                      'Code': 'InvalidInstanceID.Malformed'|'InvalidInstanceID.NotFound'|'IncorrectInstanceState'|'InstanceCreditSpecification.NotSupported',
                      'Message': 'string'
                  }
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **SuccessfulInstanceCreditSpecifications** *(list) --* 

        Information about the instances whose credit option for CPU usage was successfully modified.

        
        

        - *(dict) --* 

          Describes the burstable performance instance whose credit option for CPU usage was successfully modified.

          
          

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

            The ID of the instance.

            
      
    
      

      - **UnsuccessfulInstanceCreditSpecifications** *(list) --* 

        Information about the instances whose credit option for CPU usage was not modified.

        
        

        - *(dict) --* 

          Describes the burstable performance instance whose credit option for CPU usage was not modified.

          
          

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

            The ID of the instance.

            
          

          - **Error** *(dict) --* 

            The applicable error for the burstable performance instance whose credit option for CPU usage was not modified.

            
            

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

              The error code.

              
            

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

              The applicable error message.

              
        
      
    
  