:doc:`FSx <../../fsx>` / Client / tag_resource

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



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

  

  Tags an Amazon FSx resource.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-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 Amazon FSx resource that you want to tag.

    

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

    A list of tags for the resource. If a tag with a given key already exists, the value is replaced by the one specified in this parameter.

    

  
    - *(dict) --* 

      Specifies a key-value pair for a resource tag.

      

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

        A value that specifies the ``TagKey``, the name of the tag. Tag keys must be unique for the resource to which they are attached.

        

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

        A value that specifies the ``TagValue``, the value assigned to the corresponding tag key. Tag values can be null and don't have to be unique in a tag set. For example, you can have a key-value pair in a tag set of ``finances : April`` and also of ``payroll : April``.

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 

      The response object for the ``TagResource`` operation.

      
  
  **Exceptions**
  
  *   :py:class:`FSx.Client.exceptions.BadRequest`

  
  *   :py:class:`FSx.Client.exceptions.InternalServerError`

  
  *   :py:class:`FSx.Client.exceptions.ResourceNotFound`

  
  *   :py:class:`FSx.Client.exceptions.NotServiceResourceError`

  
  *   :py:class:`FSx.Client.exceptions.ResourceDoesNotSupportTagging`

  

  **Examples**

  This operation tags an Amazon FSx resource.
  ::

    response = client.tag_resource(
        ResourceARN='arn:aws:fsx:us-east-1:012345678912:file-system/fs-0498eed5fe91001ec',
        Tags=[
            {
                'Key': 'Name',
                'Value': 'MyFileSystem',
            },
        ],
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  