:doc:`DatabaseMigrationService <../../dms>` / Client / list_tags_for_resource

**********************
list_tags_for_resource
**********************



.. py:method:: DatabaseMigrationService.Client.list_tags_for_resource(**kwargs)

  

  Lists all metadata tags attached to an DMS resource, including replication instance, endpoint, subnet group, and migration task. For more information, see `Tag <https://docs.aws.amazon.com/dms/latest/APIReference/API_Tag.html>`__ data type description.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ListTagsForResource>`_  


  **Request Syntax**
  ::

    response = client.list_tags_for_resource(
        ResourceArn='string',
        ResourceArnList=[
            'string',
        ]
    )
    
  :type ResourceArn: string
  :param ResourceArn: 

    The Amazon Resource Name (ARN) string that uniquely identifies the DMS resource to list tags for. This returns a list of keys (names of tags) created for the resource and their associated tag values.

    

  
  :type ResourceArnList: list
  :param ResourceArnList: 

    List of ARNs that identify multiple DMS resources that you want to list tags for. This returns a list of keys (tag names) and their associated tag values. It also returns each tag's associated ``ResourceArn`` value, which is the ARN of the resource for which each listed tag is created.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'TagList': [
              {
                  'Key': 'string',
                  'Value': 'string',
                  'ResourceArn': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **TagList** *(list) --* 

        A list of tags for the resource.

        
        

        - *(dict) --* 

          A user-defined key-value pair that describes metadata added to an DMS resource and that is used by operations such as the following:

           

          
          * ``AddTagsToResource``
           
          * ``ListTagsForResource``
           
          * ``RemoveTagsFromResource``
          

          
          

          - **Key** *(string) --* 

            A key is the required name of the tag. The string value can be 1-128 Unicode characters in length and can't be prefixed with "aws:" or "dms:". The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regular expressions: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$").

            
          

          - **Value** *(string) --* 

            A value is the optional value of the tag. The string value can be 1-256 Unicode characters in length and can't be prefixed with "aws:" or "dms:". The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regular expressions: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$").

            
          

          - **ResourceArn** *(string) --* 

            The Amazon Resource Name (ARN) string that uniquely identifies the resource for which the tag is created.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.ResourceNotFoundFault`

  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.InvalidResourceStateFault`

  

  **Examples**

  Lists all tags for an AWS DMS resource.
  ::

    response = client.list_tags_for_resource(
        ResourceArn='',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'TagList': [
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  