:doc:`ElasticBeanstalk <../../elasticbeanstalk>` / Client / update_tags_for_resource

************************
update_tags_for_resource
************************



.. py:method:: ElasticBeanstalk.Client.update_tags_for_resource(**kwargs)

  

  Update the list of tags applied to an AWS Elastic Beanstalk resource. Two lists can be passed: ``TagsToAdd`` for tags to add or update, and ``TagsToRemove``.

   

  Elastic Beanstalk supports tagging of all of its resources. For details about resource tagging, see `Tagging Application Resources <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-tagging-resources.html>`__.

   

  If you create a custom IAM user policy to control permission to this operation, specify one of the following two virtual actions (or both) instead of the API operation name:

    elasticbeanstalk:AddTags  

  Controls permission to call ``UpdateTagsForResource`` and pass a list of tags to add in the ``TagsToAdd`` parameter.

    elasticbeanstalk:RemoveTags  

  Controls permission to call ``UpdateTagsForResource`` and pass a list of tag keys to remove in the ``TagsToRemove`` parameter.

     

  For details about creating a custom user policy, see `Creating a Custom User Policy <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.iam.managed-policies.html#AWSHowTo.iam.policies>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateTagsForResource>`_  


  **Request Syntax**
  ::

    response = client.update_tags_for_resource(
        ResourceArn='string',
        TagsToAdd=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        TagsToRemove=[
            'string',
        ]
    )
    
  :type ResourceArn: string
  :param ResourceArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the resouce to be updated.

     

    Must be the ARN of an Elastic Beanstalk resource.

    

  
  :type TagsToAdd: list
  :param TagsToAdd: 

    A list of tags to add or update. If a key of an existing tag is added, the tag's value is updated.

     

    Specify at least one of these parameters: ``TagsToAdd``, ``TagsToRemove``.

    

  
    - *(dict) --* 

      Describes a tag applied to a resource in an environment.

      

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

        The key of the tag.

        

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

        The value of the tag.

        

      
    

  :type TagsToRemove: list
  :param TagsToRemove: 

    A list of tag keys to remove. If a tag key doesn't exist, it is silently ignored.

     

    Specify at least one of these parameters: ``TagsToAdd``, ``TagsToRemove``.

    

  
    - *(string) --* 

    

  
  :returns: None
  **Exceptions**
  
  *   :py:class:`ElasticBeanstalk.Client.exceptions.InsufficientPrivilegesException`

  
  *   :py:class:`ElasticBeanstalk.Client.exceptions.OperationInProgressException`

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

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

  
  *   :py:class:`ElasticBeanstalk.Client.exceptions.ResourceTypeNotSupportedException`

  