:doc:`AuroraDSQL <../../dsql>` / Client / put_cluster_policy

******************
put_cluster_policy
******************



.. py:method:: AuroraDSQL.Client.put_cluster_policy(**kwargs)

  

  Attaches a resource-based policy to a cluster. This policy defines access permissions and conditions for the cluster, allowing you to control which principals can perform actions on the cluster.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/dsql-2018-05-10/PutClusterPolicy>`_  


  **Request Syntax**
  ::

    response = client.put_cluster_policy(
        identifier='string',
        policy='string',
        bypassPolicyLockoutSafetyCheck=True|False,
        expectedPolicyVersion='string',
        clientToken='string'
    )
    
  :type identifier: string
  :param identifier: **[REQUIRED]** 

    The ID of the cluster.

    

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

    The resource-based policy document to attach to the cluster. This should be a valid JSON policy document that defines permissions and conditions.

    

  
  :type bypassPolicyLockoutSafetyCheck: boolean
  :param bypassPolicyLockoutSafetyCheck: 

    A flag that allows you to bypass the policy lockout safety check. When set to true, this parameter allows you to apply a policy that might lock you out of the cluster. Use with caution.

    

  
  :type expectedPolicyVersion: string
  :param expectedPolicyVersion: 

    The expected version of the current policy. This parameter ensures that you're updating the correct version of the policy and helps prevent concurrent modification conflicts.

    

  
  :type clientToken: string
  :param clientToken: 

    Idempotency token so a request is only processed once.

    This field is autopopulated if not provided.

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

    
    ::

      {
          'policyVersion': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **policyVersion** *(string) --* 

        The version of the policy after it has been updated or created.

        
  
  **Exceptions**
  
  *   :py:class:`AuroraDSQL.Client.exceptions.ThrottlingException`

  
  *   :py:class:`AuroraDSQL.Client.exceptions.ValidationException`

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

  
  *   :py:class:`AuroraDSQL.Client.exceptions.InternalServerException`

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

  
  *   :py:class:`AuroraDSQL.Client.exceptions.ConflictException`

  