:doc:`CloudHSMV2 <../../cloudhsmv2>` / Client / tag_resource

************
tag_resource
************



.. py:method:: CloudHSMV2.Client.tag_resource(**kwargs)

  

  Adds or overwrites one or more tags for the specified CloudHSM cluster.

   

  **Cross-account use:** No. You cannot perform this operation on an CloudHSM resource in a different Amazon Web Services account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/TagResource>`_  


  **Request Syntax**
  ::

    response = client.tag_resource(
        ResourceId='string',
        TagList=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ResourceId: string
  :param ResourceId: **[REQUIRED]** 

    The cluster identifier (ID) for the cluster that you are tagging. To find the cluster ID, use  DescribeClusters.

    

  
  :type TagList: list
  :param TagList: **[REQUIRED]** 

    A list of one or more tags.

    

  
    - *(dict) --* 

      Contains a tag. A tag is a key-value pair.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The key of the tag.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        The value of the tag.

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmAccessDeniedException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmInternalFailureException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmInvalidRequestException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmResourceLimitExceededException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmResourceNotFoundException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmServiceException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmTagException`

  