:doc:`CloudFrontKeyValueStore <../../cloudfront-keyvaluestore>` / Client / put_key

*******
put_key
*******



.. py:method:: CloudFrontKeyValueStore.Client.put_key(**kwargs)

  

  Creates a new key value pair or replaces the value of an existing key.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/PutKey>`_  


  **Request Syntax**
  ::

    response = client.put_key(
        Key='string',
        Value='string',
        KvsARN='string',
        IfMatch='string'
    )
    
  :type Key: string
  :param Key: **[REQUIRED]** 

    The key to put.

    

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

    The value to put.

    

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

    The Amazon Resource Name (ARN) of the Key Value Store.

    

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

    The current version (ETag) of the Key Value Store that you are putting keys into, which you can get using DescribeKeyValueStore.

    

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

    
    ::

      {
          'ItemCount': 123,
          'TotalSizeInBytes': 123,
          'ETag': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Metadata information about a Key Value Store.

      
      

      - **ItemCount** *(integer) --* 

        Number of key value pairs in the Key Value Store after the successful put.

        
      

      - **TotalSizeInBytes** *(integer) --* 

        Total size of the Key Value Store after the successful put, in bytes.

        
      

      - **ETag** *(string) --* 

        The current version identifier of the Key Value Store after the successful put.

        
  
  **Exceptions**
  
  *   :py:class:`CloudFrontKeyValueStore.Client.exceptions.ConflictException`

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

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

  
  *   :py:class:`CloudFrontKeyValueStore.Client.exceptions.ServiceQuotaExceededException`

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

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

  