:doc:`ManagedBlockchain <../../managedblockchain>` / Client / tag_resource

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



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

  

  Adds or overwrites the specified tags for the specified Amazon Managed Blockchain resource. Each tag consists of a key and optional value.

   

  When you specify a tag key that already exists, the tag value is overwritten with the new value. Use ``UntagResource`` to remove tag keys.

   

  A resource can have up to 50 tags. If you try to create more than 50 tags for a resource, your request fails and returns an error.

   

  For more information about tags, see `Tagging Resources <https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html>`__ in the *Amazon Managed Blockchain Ethereum Developer Guide*, or `Tagging Resources <https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html>`__ in the *Amazon Managed Blockchain Hyperledger Fabric Developer Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-2018-09-24/TagResource>`_  


  **Request Syntax**
  ::

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

    The Amazon Resource Name (ARN) of the resource. For more information about ARNs and their format, see `Amazon Resource Names (ARNs) <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ in the *Amazon Web Services General Reference*.

    

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

    The tags to assign to the specified resource. Tag values can be empty, for example, ``"MyTagKey" : ""``. You can specify multiple key-value pairs in a single request, with an overall maximum of 50 tags added to each resource.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`ManagedBlockchain.Client.exceptions.InternalServiceErrorException`

  
  *   :py:class:`ManagedBlockchain.Client.exceptions.InvalidRequestException`

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

  
  *   :py:class:`ManagedBlockchain.Client.exceptions.TooManyTagsException`

  
  *   :py:class:`ManagedBlockchain.Client.exceptions.ResourceNotReadyException`

  