:doc:`IAM <../../iam>` / Client / delete_instance_profile

***********************
delete_instance_profile
***********************



.. py:method:: IAM.Client.delete_instance_profile(**kwargs)

  

  Deletes the specified instance profile. The instance profile must not have an associated role.

   

  .. warning::

     

    Make sure that you do not have any Amazon EC2 instances running with the instance profile you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.

     

   

  For more information about instance profiles, see `Using instance profiles <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html>`__ in the *IAM User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfile>`_  


  **Request Syntax**
  ::

    response = client.delete_instance_profile(
        InstanceProfileName='string'
    )
    
  :type InstanceProfileName: string
  :param InstanceProfileName: **[REQUIRED]** 

    The name of the instance profile to delete.

     

    This parameter allows (through its `regex pattern <http://wikipedia.org/wiki/regex>`__) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`IAM.Client.exceptions.NoSuchEntityException`

  
  *   :py:class:`IAM.Client.exceptions.DeleteConflictException`

  
  *   :py:class:`IAM.Client.exceptions.LimitExceededException`

  
  *   :py:class:`IAM.Client.exceptions.ServiceFailureException`

  

  **Examples**

  The following command deletes the instance profile named ExampleInstanceProfile
  ::

    response = client.delete_instance_profile(
        InstanceProfileName='ExampleInstanceProfile',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  