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

***************
associate_alias
***************



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

  

  

  .. note::

    

    The ``AssociateAlias`` API operation only supports standard distributions. To move domains between distribution tenants and/or standard distributions, we recommend that you use the `UpdateDomainAssociation <https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDomainAssociation.html>`__ API operation instead.

    

   

  Associates an alias with a CloudFront standard distribution. An alias is commonly known as a custom domain or vanity domain. It can also be called a CNAME or alternate domain name.

   

  With this operation, you can move an alias that's already used for a standard distribution to a different standard distribution. This prevents the downtime that could occur if you first remove the alias from one standard distribution and then separately add the alias to another standard distribution.

   

  To use this operation, specify the alias and the ID of the target standard distribution.

   

  For more information, including how to set up the target standard distribution, 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/AssociateAlias>`_  


  **Request Syntax**
  ::

    response = client.associate_alias(
        TargetDistributionId='string',
        Alias='string'
    )
    
  :type TargetDistributionId: string
  :param TargetDistributionId: **[REQUIRED]** 

    The ID of the standard distribution that you're associating the alias with.

    

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

    The alias (also known as a CNAME) to add to the target standard distribution.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`CloudFront.Client.exceptions.NoSuchDistribution`

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

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

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

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

  