:doc:`SSM <../../ssm>` / Client / update_managed_instance_role

****************************
update_managed_instance_role
****************************



.. py:method:: SSM.Client.update_managed_instance_role(**kwargs)

  

  Changes the Identity and Access Management (IAM) role that is assigned to the on-premises server, edge device, or virtual machines (VM). IAM roles are first assigned to these hybrid nodes during the activation process. For more information, see  CreateActivation.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateManagedInstanceRole>`_  


  **Request Syntax**
  ::

    response = client.update_managed_instance_role(
        InstanceId='string',
        IamRole='string'
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The ID of the managed node where you want to update the role.

    

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

    The name of the Identity and Access Management (IAM) role that you want to assign to the managed node. This IAM role must provide AssumeRole permissions for the Amazon Web Services Systems Manager service principal ``ssm.amazonaws.com``. For more information, see `Create the IAM service role required for Systems Manager in hybrid and multicloud environments <https://docs.aws.amazon.com/systems-manager/latest/userguide/hybrid-multicloud-service-role.html>`__ in the *Amazon Web Services Systems Manager User Guide*.

     

    .. note::

      

      You can't specify an IAM service-linked role for this parameter. You must create a unique role.

      

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`SSM.Client.exceptions.InvalidInstanceId`

  
  *   :py:class:`SSM.Client.exceptions.InternalServerError`

  