AssociateAlias - Amazon CloudFront
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Associates an alias (also known as a CNAME or an alternate domain name) with a CloudFront distribution.

With this operation you can move an alias that's already in use on a CloudFront distribution to a different distribution in one step. This prevents the downtime that could occur if you first remove the alias from one distribution and then separately add the alias to another distribution.

To use this operation to associate an alias with a distribution, you provide the alias and the ID of the target distribution for the alias. For more information, including how to set up the target distribution, prerequisites that you must complete, and other restrictions, see Moving an alternate domain name to a different distribution in the Amazon CloudFront Developer Guide.

Request Syntax

PUT /2020-05-31/distribution/TargetDistributionId/associate-alias?Alias=Alias HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.


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

Required: Yes


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

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.


For information about the errors that are common to all actions, see Common Errors.


Access denied.

HTTP Status Code: 403


The update contains modifications that are not allowed.

HTTP Status Code: 400


An argument is invalid.

HTTP Status Code: 400


The specified distribution does not exist.

HTTP Status Code: 404


Your request contains more CNAMEs than are allowed per distribution.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: