SetAlias
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.
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.
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
- AliasName
-
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.
NoteAn 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.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Required: Yes
- StackName
-
The name or unique stack ID of the stack to assign an alias to.
Type: String
Required: Yes
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AlreadyExists
-
The resource with the name requested already exists.
HTTP Status Code: 400
- LimitExceeded
-
The quota for the resource has already been reached.
For information about resource and stack limitations, see CloudFormation quotas in the AWS CloudFormation User Guide.
HTTP Status Code: 400
Examples
SetAlias
This example illustrates one usage of SetAlias.
Sample Request
https://cloudformation.us-east-1.amazonaws.com/
?Action=SetAlias
&StackName=MyStack
&AliasName=MyAlias
&Version=2010-05-15
&SignatureVersion=2
&Timestamp=2010-07-27T22%3A26%3A28.000Z
&AWSAccessKeyId=[AWS Access KeyID]
&Signature=[Signature]
Sample Response
<SetAliasResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
<ResponseMetadata>
<RequestId>a1b2c3d4-5678-90ab-cdef-example11111</RequestId>
</ResponseMetadata>
</SetAliasResponse>
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: