:doc:`CloudWatchLogs <../../logs>` / Client / put_log_group_deletion_protection

*********************************
put_log_group_deletion_protection
*********************************



.. py:method:: CloudWatchLogs.Client.put_log_group_deletion_protection(**kwargs)

  

  Enables or disables deletion protection for the specified log group. When enabled on a log group, deletion protection blocks all deletion operations until it is explicitly disabled.

   

  For information about the parameters that are common to all actions, see `Common Parameters <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/CommonParameters.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutLogGroupDeletionProtection>`_  


  **Request Syntax**
  ::

    response = client.put_log_group_deletion_protection(
        logGroupIdentifier='string',
        deletionProtectionEnabled=True|False
    )
    
  :type logGroupIdentifier: string
  :param logGroupIdentifier: **[REQUIRED]** 

    The name or ARN of the log group.

     

    Type: String

     

    Length Constraints: Minimum length of 1. Maximum length of 512.

     

    Pattern: ``[\.\-_/#A-Za-z0-9]+``

     

    Required: Yes

    

  
  :type deletionProtectionEnabled: boolean
  :param deletionProtectionEnabled: **[REQUIRED]** 

    Whether to enable deletion protection.

     

    Type: Boolean

     

    Required: Yes

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`CloudWatchLogs.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.OperationAbortedException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.InvalidOperationException`

  