:doc:`CloudFront <../../cloudfront>` / Client / update_domain_association

*************************
update_domain_association
*************************



.. py:method:: CloudFront.Client.update_domain_association(**kwargs)

  

  

  .. note::

    

    We recommend that you use the ``UpdateDomainAssociation`` API operation to move a domain association, as it supports both standard distributions and distribution tenants. `AssociateAlias <https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_AssociateAlias.html>`__ performs similar checks but only supports standard distributions.

    

   

  Moves a domain from its current standard distribution or distribution tenant to another one.

   

  You must first disable the source distribution (standard distribution or distribution tenant) and then separately call this operation to move the domain to another target distribution (standard distribution or distribution tenant).

   

  To use this operation, specify the domain and the ID of the target resource (standard distribution or distribution tenant). For more information, including how to set up the target resource, prerequisites that you must complete, and other restrictions, see `Moving an alternate domain name to a different standard distribution or distribution tenant <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-move>`__ in the *Amazon CloudFront Developer Guide*.

  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/UpdateDomainAssociation>`_  


  **Request Syntax**
  ::

    response = client.update_domain_association(
        Domain='string',
        TargetResource={
            'DistributionId': 'string',
            'DistributionTenantId': 'string'
        },
        IfMatch='string'
    )
    
  :type Domain: string
  :param Domain: **[REQUIRED]** 

    The domain to update.

    

  
  :type TargetResource: dict
  :param TargetResource: **[REQUIRED]** 

    The target standard distribution or distribution tenant resource for the domain. You can specify either ``DistributionId`` or ``DistributionTenantId``, but not both.

    

  
    - **DistributionId** *(string) --* 

      The ID of the multi-tenant distribution.

      

    
    - **DistributionTenantId** *(string) --* 

      The ID of the distribution tenant.

      

    
  
  :type IfMatch: string
  :param IfMatch: 

    The value of the ``ETag`` identifier for the standard distribution or distribution tenant that will be associated with the domain.

    

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

    
    ::

      {
          'Domain': 'string',
          'ResourceId': 'string',
          'ETag': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Domain** *(string) --* 

        The domain that you're moving.

        
      

      - **ResourceId** *(string) --* 

        The intended destination for the domain.

        
      

      - **ETag** *(string) --* 

        The current version of the target standard distribution or distribution tenant that was associated with the domain.

        
  
  **Exceptions**
  
  *   :py:class:`CloudFront.Client.exceptions.PreconditionFailed`

  
  *   :py:class:`CloudFront.Client.exceptions.AccessDenied`

  
  *   :py:class:`CloudFront.Client.exceptions.EntityNotFound`

  
  *   :py:class:`CloudFront.Client.exceptions.IllegalUpdate`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidArgument`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidIfMatchVersion`

  