:doc:`ComputeOptimizerAutomation <../../compute-optimizer-automation>` / Client / tag_resource

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



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

  

  Adds tags to the specified resource.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/compute-optimizer-automation-2025-09-22/TagResource>`_  


  **Request Syntax**
  ::

    response = client.tag_resource(
        resourceArn='string',
        ruleRevision=123,
        tags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ],
        clientToken='string'
    )
    
  :type resourceArn: string
  :param resourceArn: **[REQUIRED]** 

    The ARN of the resource to tag.

    

  
  :type ruleRevision: integer
  :param ruleRevision: **[REQUIRED]** 

    The revision number of the automation rule to tag. This ensures you're tagging the correct version of the rule.

    

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

    The tags to add to the resource.

    

  
    - *(dict) --* 

      A key-value pair used to categorize and organize Amazon Web Services resources and automation rules.

      

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

        The tag key, which can be up to 128 characters long.

        

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

        The tag value, which can be up to 256 characters long.

        

      
    

  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Must be 1-64 characters long and contain only alphanumeric characters, underscores, and hyphens.

    This field is autopopulated if not provided.

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.ForbiddenException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.OptInRequiredException`

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

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.ThrottlingException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.IdempotentParameterMismatchException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.InternalServerException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.IdempotencyTokenInUseException`

  