:doc:`PrometheusService <../../amp>` / Client / tag_resource

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



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

  

  The ``TagResource`` operation associates tags with an Amazon Managed Service for Prometheus resource. The only resources that can be tagged are rule groups namespaces, scrapers, and workspaces.

   

  If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag. To remove a tag, use ``UntagResource``.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/TagResource>`_  


  **Request Syntax**
  ::

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

    The ARN of the resource to apply tags to.

    

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

    The list of tag keys and values to associate with the resource.

     

    Keys must not begin with ``aws:``.

    

  
    - *(string) --* 

      The key of the tag. Must not begin with ``aws:``.

      

    
      - *(string) --* 

        The value of the tag.

        

      


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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`PrometheusService.Client.exceptions.ThrottlingException`

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

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

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

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

  