:doc:`GameLift <../../gamelift>` / Client / tag_resource

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



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

  

  **This API works with the following fleet types:** EC2, Anywhere, Container

   

  Assigns a tag to an Amazon GameLift Servers resource. You can use tags to organize resources, create IAM permissions policies to manage access to groups of resources, customize Amazon Web Services cost breakdowns, and more. This operation handles the permissions necessary to manage tags for Amazon GameLift Servers resources that support tagging.

   

  To add a tag to a resource, specify the unique ARN value for the resource and provide a tag list containing one or more tags. The operation succeeds even if the list includes tags that are already assigned to the resource.

   

  **Learn more**

   

  `Tagging Amazon Web Services Resources <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html>`__ in the *Amazon Web Services General Reference*

   

  `Amazon Web Services Tagging Strategies <http://aws.amazon.com/answers/account-management/aws-tagging-strategies/>`__

   

  **Related actions**

   

  `All APIs by task <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets>`__

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-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 <https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html>`__) that uniquely identifies the Amazon GameLift Servers resource that you want to assign tags to. Amazon GameLift Servers includes resource ARNs in the data object for the resource. You can retrieve the ARN by calling a ``List`` or ``Describe`` operation for the resource type.

    

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

    A list of one or more tags to assign to the specified Amazon GameLift Servers resource. Tags are developer-defined and structured as key-value pairs. The maximum tag limit may be lower than stated. See `Tagging Amazon Web Services Resources <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html>`__ for tagging limits.

    

  
    - *(dict) --* 

      A label that you can assign to a Amazon GameLift Servers resource.

       

      **Learn more**

       

      `Tagging Amazon Web Services Resources <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html>`__ in the *Amazon Web Services General Reference*

       

      `Amazon Web Services Tagging Strategies <http://aws.amazon.com/answers/account-management/aws-tagging-strategies/>`__

       

      **Related actions**

       

      `All APIs by task <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets>`__

      

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

        The key for a developer-defined key value pair for tagging an Amazon Web Services resource.

        

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

        The value for a developer-defined key value pair for tagging an Amazon Web Services resource.

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`GameLift.Client.exceptions.NotFoundException`

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

  
  *   :py:class:`GameLift.Client.exceptions.TaggingFailedException`

  
  *   :py:class:`GameLift.Client.exceptions.InternalServiceException`

  
  *   :py:class:`GameLift.Client.exceptions.UnsupportedRegionException`

  