AssociateAlias - Amazon CloudFront

AssociateAlias

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.

Alias

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

Required: Yes

TargetDistributionId

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.

Errors

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

AccessDenied

Access denied.

HTTP Status Code: 403

IllegalUpdate

The update contains modifications that are not allowed.

HTTP Status Code: 400

InvalidArgument

An argument is invalid.

HTTP Status Code: 400

NoSuchDistribution

The specified distribution does not exist.

HTTP Status Code: 404

TooManyDistributionCNAMEs

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 AWS SDKs, see the following: