Skip to content

CloudFront  >  Operations  >  associate_alias

associate_alias

Operation

associate_alias async

associate_alias(input: AssociateAliasInput, plugins: list[Plugin] | None = None) -> AssociateAliasOutput
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 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 in the Amazon CloudFront Developer Guide.

Parameters:

Name Type Description Default
input AssociateAliasInput

An instance of AssociateAliasInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
AssociateAliasOutput

An instance of AssociateAliasOutput.

Input

AssociateAliasInput dataclass

Bases: _SerdeShape

Dataclass for AssociateAliasInput structure.

Attributes

alias class-attribute instance-attribute
alias: str | None = ...

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

target_distribution_id class-attribute instance-attribute
target_distribution_id: str | None = ...

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

Output

AssociateAliasOutput dataclass

Bases: _SerdeShape

Dataclass for AssociateAliasOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.