Alibaba Cloud Function Compute provides the alias management feature. An alias is a resource used for version management. By using aliases and versions, you can implement continuous integration and continuous delivery in the software development lifecycle.
As a resource in Function Compute, an alias can be considered as a pointer to a specific service version. An alias is dependent on a service or a version. When you use an alias to access a service or function, Function Compute parses the alias into the version that the alias points to. This frees the caller from needing to know the specific version that the alias points to.
Function Compute allows you to create an alias for a service version. The alias points to a specific service version and can be modified. An alias cannot point to other aliases. You can use an alias to easily publish, roll back, or canary release a version.
Assume that a third party triggers your function by using an HTTP trigger and no aliases are configured for your service. Each time a new service version is published, you must manually modify the version associated with the HTTP trigger, and the modification will affect the user experience on the client. In contrast, if you use an alias to manage the version, you can upgrade the version hitlessly.
For example, you can set alias PROD to point to stable version 1. If a trigger is created for your function, you can associate the trigger with alias PROD. For more information, see Use aliases in triggers. The client directly uses alias PROD to call the function for the service of version 1.
After version 1 is published, you can continue to develop new features over the LATEST version. In this example, the client calls functions for the service of the corresponding version by using an alias. Therefore, when you need to publish version 2, you only need to change alias PROD to point to version 2. In this way, when the client calls the function, version 2 is parsed out, implementing easy version update. In addition, you can point the alias to an earlier version to roll back the version. For example, you can change alias PROD to point to an earlier version than version 1. In this way, you can publish a version without needing to frequently update triggers or deteriorate the user experience on the client.
When you create an alias, you must specify the parameters described in the following table.
|AliasName||Yes||The name of the alias. The alias name must be unique in the current Function Compute service and comply with the following constraints:
|VersionId||Yes||The version to which the alias points. An alias cannot point to the LATEST version reserved by the system.|
|Description||No||The description of the alias.|
|AdditionalVersionWeight||No||The additional version to which the alias points and the weight of the additional version.