:doc:`DirectoryService <../../ds>` / Client / add_tags_to_resource

********************
add_tags_to_resource
********************



.. py:method:: DirectoryService.Client.add_tags_to_resource(**kwargs)

  

  Adds or overwrites one or more tags for the specified directory. Each directory can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique to each resource.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddTagsToResource>`_  


  **Request Syntax**
  ::

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

    Identifier (ID) for the directory to which to add the tag.

    

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

    The tags to be assigned to the directory.

    

  
    - *(dict) --* 

      Metadata assigned to a directory consisting of a key-value pair.

      

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

        Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@'(Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$").

        

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

        The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$").

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`DirectoryService.Client.exceptions.EntityDoesNotExistException`

  
  *   :py:class:`DirectoryService.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`DirectoryService.Client.exceptions.TagLimitExceededException`

  
  *   :py:class:`DirectoryService.Client.exceptions.ClientException`

  
  *   :py:class:`DirectoryService.Client.exceptions.ServiceException`

  