AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginAssociateAlias and EndAssociateAlias.

Namespace: Amazon.CloudFront
Assembly: AWSSDK.CloudFront.dll
Version: 3.x.y.z

Syntax

C#
public abstract Task<AssociateAliasResponse> AssociateAliasAsync(
         AssociateAliasRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.CloudFront.Model.AssociateAliasRequest

Container for the necessary parameters to execute the AssociateAlias service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the AssociateAlias service method, as returned by CloudFront.

Exceptions

ExceptionCondition
AccessDeniedException Access denied.
IllegalUpdateException The update contains modifications that are not allowed.
InvalidArgumentException An argument is invalid.
NoSuchDistributionException The specified distribution does not exist.
TooManyDistributionCNAMEsException Your request contains more CNAMEs than are allowed per distribution.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5

See Also