:doc:`OpenSearchServiceServerless <../../opensearchserverless>` / Client / tag_resource

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



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

  

  Associates tags with an OpenSearch Serverless resource. For more information, see `Tagging Amazon OpenSearch Serverless collections <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-collection.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/TagResource>`_  


  **Request Syntax**
  ::

    response = client.tag_resource(
        resourceArn='string',
        tags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ]
    )
    
  :type resourceArn: string
  :param resourceArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the resource. The resource must be active (not in the ``DELETING`` state), and must be owned by the account ID included in the request.

    

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

    A list of tags (key-value pairs) to add to the resource. All tag keys in the request must be unique.

    

  
    - *(dict) --* 

      A map of key-value pairs associated to an OpenSearch Serverless resource.

      

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

        The key to use in the tag.

        

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

        The value of the tag.

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.InternalServerException`

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

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

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

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

  