:doc:`ElastiCache <../../elasticache>` / Client / delete_user

***********
delete_user
***********



.. py:method:: ElastiCache.Client.delete_user(**kwargs)

  

  For Valkey engine version 7.2 onwards and Redis OSS 6.0 onwards: Deletes a user. The user will be removed from all user groups and in turn removed from all replication groups. For more information, see `Using Role Based Access Control (RBAC) <http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.RBAC.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteUser>`_  


  **Request Syntax**
  ::

    response = client.delete_user(
        UserId='string'
    )
    
  :type UserId: string
  :param UserId: **[REQUIRED]** 

    The ID of the user.

    

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

    
    ::

      {
          'UserId': 'string',
          'UserName': 'string',
          'Status': 'string',
          'Engine': 'string',
          'MinimumEngineVersion': 'string',
          'AccessString': 'string',
          'UserGroupIds': [
              'string',
          ],
          'Authentication': {
              'Type': 'password'|'no-password'|'iam',
              'PasswordCount': 123
          },
          'ARN': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **UserId** *(string) --* 

        The ID of the user.

        
      

      - **UserName** *(string) --* 

        The username of the user.

        
      

      - **Status** *(string) --* 

        Indicates the user status. Can be "active", "modifying" or "deleting".

        
      

      - **Engine** *(string) --* 

        The options are valkey or redis.

        
      

      - **MinimumEngineVersion** *(string) --* 

        The minimum engine version required, which is Redis OSS 6.0

        
      

      - **AccessString** *(string) --* 

        Access permissions string used for this user.

        
      

      - **UserGroupIds** *(list) --* 

        Returns a list of the user group IDs the user belongs to.

        
        

        - *(string) --* 
    
      

      - **Authentication** *(dict) --* 

        Denotes whether the user requires a password to authenticate.

        
        

        - **Type** *(string) --* 

          Indicates whether the user requires a password to authenticate.

          
        

        - **PasswordCount** *(integer) --* 

          The number of passwords belonging to the user. The maximum is two.

          
    
      

      - **ARN** *(string) --* 

        The Amazon Resource Name (ARN) of the user.

        
  
  **Exceptions**
  
  *   :py:class:`ElastiCache.Client.exceptions.InvalidUserStateFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.UserNotFoundFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.ServiceLinkedRoleNotFoundFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`ElastiCache.Client.exceptions.DefaultUserAssociatedToUserGroupFault`

  