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

*****************
monitor_instances
*****************



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

  

  Enables detailed monitoring for a running instance. Otherwise, basic monitoring is enabled. For more information, see `Monitor your instances using CloudWatch <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html>`__ in the *Amazon EC2 User Guide*.

   

  To disable detailed monitoring, see `UnmonitorInstances <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_UnmonitorInstances.html>`__.

  

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


  **Request Syntax**
  ::

    response = client.monitor_instances(
        InstanceIds=[
            'string',
        ],
        DryRun=True|False
    )
    
  :type InstanceIds: list
  :param InstanceIds: **[REQUIRED]** 

    The IDs of the instances.

    

  
    - *(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``.

    

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

    
    ::

      {
          'InstanceMonitorings': [
              {
                  'InstanceId': 'string',
                  'Monitoring': {
                      'State': 'disabled'|'disabling'|'enabled'|'pending'
                  }
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **InstanceMonitorings** *(list) --* 

        The monitoring information.

        
        

        - *(dict) --* 

          Describes the monitoring of an instance.

          
          

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

            The ID of the instance.

            
          

          - **Monitoring** *(dict) --* 

            The monitoring for the instance.

            
            

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

              Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

              
        
      
    
  