CloudFormation / Client / set_alias

set_alias

CloudFormation.Client.set_alias(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.set_alias(
    StackName='string',
    AliasName='string'
)
Parameters:
  • StackName (string) –

    [REQUIRED]

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

  • AliasName (string) –

    [REQUIRED]

    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.

Returns:

None

Exceptions

  • CloudFormation.Client.exceptions.LimitExceededException

  • CloudFormation.Client.exceptions.AlreadyExistsException