Skip to content

CloudFormation  >  Operations  >  set_alias

set_alias

Operation

set_alias async

set_alias(request: SetAliasInput | SetAliasInputDict, /, *, plugins: list[Plugin] | None = None) -> SetAliasOutput
set_alias(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[SetAliasInputDict]) -> SetAliasOutput

Assigns an alias to an existing stack. An alias is an alternative name for a stack that can be used in place of the stack name in any CloudFormation API call that accepts the StackName parameter. This enables you to effectively rename a stack without recreating it.

After setting an alias, both the original stack name and the alias resolve to the same stack. Setting an alias does not change the stack's ARN, physical resource IDs, or any deployed resources.

Note

Each stack can have at most one alias. To change a stack's alias, first remove the existing alias using RemoveAlias, then set a new one.

Parameters:

Name Type Description Default
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
SetAliasOutput

An instance of SetAliasOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

SetAliasInput dataclass

Bases: _SerdeShape

The input for the SetAlias action.

Attributes
alias_name class-attribute instance-attribute
alias_name: str | None = ...

The alias to assign to the stack. The alias can then be used in place of the stack name in any API call that accepts StackName.

The name must be unique within the same account and Region. It cannot match an existing stack name or another active alias.

Note

An alias name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphabetic character and can't be longer than 128 characters.

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

The name or unique stack ID of the stack to assign an alias to.

Dictionaries

SetAliasInputDict

Bases: TypedDict

Dictionary form of SetAliasInput.

Attributes
alias_name instance-attribute
alias_name: Required[str]

The alias to assign to the stack. The alias can then be used in place of the stack name in any API call that accepts StackName.

The name must be unique within the same account and Region. It cannot match an existing stack name or another active alias.

Note

An alias name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphabetic character and can't be longer than 128 characters.

stack_name instance-attribute
stack_name: Required[str]

The name or unique stack ID of the stack to assign an alias to.

Output

SetAliasOutput dataclass

Bases: _SerdeShape

Dataclass for SetAliasOutput 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.