:doc:`Route53 <../../route53>` / Client / change_tags_for_resource

************************
change_tags_for_resource
************************



.. py:method:: Route53.Client.change_tags_for_resource(**kwargs)

  

  Adds, edits, or deletes tags for a health check or a hosted zone.

   

  For information about using tags for cost allocation, see `Using Cost Allocation Tags <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html>`__ in the *Billing and Cost Management User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResource>`_  


  **Request Syntax**
  ::

    response = client.change_tags_for_resource(
        ResourceType='healthcheck'|'hostedzone',
        ResourceId='string',
        AddTags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        RemoveTagKeys=[
            'string',
        ]
    )
    
  :type ResourceType: string
  :param ResourceType: **[REQUIRED]** 

    The type of the resource.

     

    
    * The resource type for health checks is ``healthcheck``.
     
    * The resource type for hosted zones is ``hostedzone``.
    

    

  
  :type ResourceId: string
  :param ResourceId: **[REQUIRED]** 

    The ID of the resource for which you want to add, change, or delete tags.

    

  
  :type AddTags: list
  :param AddTags: 

    A complex type that contains a list of the tags that you want to add to the specified health check or hosted zone and/or the tags that you want to edit ``Value`` for.

     

    You can add a maximum of 10 tags to a health check or a hosted zone.

    

  
    - *(dict) --* 

      A complex type that contains information about a tag that you want to add or edit for the specified health check or hosted zone.

      

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

        The value of ``Key`` depends on the operation that you want to perform:

         

        
        * **Add a tag to a health check or hosted zone**: ``Key`` is the name that you want to give the new tag.
         
        * **Edit a tag**: ``Key`` is the name of the tag that you want to change the ``Value`` for.
         
        * **Delete a key**: ``Key`` is the name of the tag you want to remove.
         
        * **Give a name to a health check**: Edit the default ``Name`` tag. In the Amazon Route 53 console, the list of your health checks includes a **Name** column that lets you see the name that you've given to each health check.
        

        

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

        The value of ``Value`` depends on the operation that you want to perform:

         

        
        * **Add a tag to a health check or hosted zone**: ``Value`` is the value that you want to give the new tag.
         
        * **Edit a tag**: ``Value`` is the new value that you want to assign the tag.
        

        

      
    

  :type RemoveTagKeys: list
  :param RemoveTagKeys: 

    A complex type that contains a list of the tags that you want to delete from the specified health check or hosted zone. You can specify up to 10 keys.

    

  
    - *(string) --* 

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 

      Empty response for the request.

      
  
  **Exceptions**
  
  *   :py:class:`Route53.Client.exceptions.InvalidInput`

  
  *   :py:class:`Route53.Client.exceptions.NoSuchHealthCheck`

  
  *   :py:class:`Route53.Client.exceptions.NoSuchHostedZone`

  
  *   :py:class:`Route53.Client.exceptions.PriorRequestNotComplete`

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

  

  **Examples**

  The following example adds two tags and removes one tag from the hosted zone with ID Z3M3LMPEXAMPLE.
  ::

    response = client.change_tags_for_resource(
        AddTags=[
            {
                'Key': 'apex',
                'Value': '3874',
            },
            {
                'Key': 'acme',
                'Value': '4938',
            },
        ],
        RemoveTagKeys=[
            'Nadir',
        ],
        ResourceId='Z3M3LMPEXAMPLE',
        # Valid values are healthcheck and hostedzone.
        ResourceType='hostedzone',
    )
    
    print(response)

  
  Expected Output:
  ::

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

  