Updated on 2025-08-19 GMT+08:00

Aliases

FunctionGraph allows you to create aliases for functions and associate aliases with specified function versions. When you invoke a function using an alias, the function of the specified version is invoked. In actual service scenarios, you can update or roll back a function version by modifying the version configured for an alias. The client is unaware of the change.

An alias can point to up to two versions with different weights for dark launch.

Notes and Constraints

  • You can create up to 10 aliases for a function.
  • A maximum of two function versions can be configured for an alias.

Creating an Alias

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the name of a function.
  3. On the Aliases tab page, click Create Alias. Create an alias to point to the current function version. You can use the alias to invoke this version.
    Table 1 Parameters for creating an alias

    Parameter

    Description

    Alias

    Custom alias name. The name can contain a maximum of 63 characters and must start with a letter and end with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    Version

    Select the function version to be associated. Only one alias can be created for each version.

    Traffic Shifting

    Choose whether to enable traffic shifting. If this function is enabled, you can distribute a specific percentage of traffic to the additional version.

    Additional Version

    This parameter is mandatory only when Traffic Shifting is enabled.

    Select an additional version to be associated. The latest version cannot be used as an additional version. For details about how to create a version, see Versions.

    Shift By

    This parameter is mandatory only when Traffic Shifting is enabled.

    Select the traffic shifting type of the additional version.

    • Percentage: Set a weight to shift the corresponding percentage of requests to the additional version. For example, if you set the percentage to 5%, FunctionGraph will forward 5% of requests to the additional version and the remaining to the main version.
    • Rule: Requests that meet the specified rules will be forwarded to the additional version. This mode is supported only by HTTP functions or functions using the APIG trigger.

    Weight

    This parameter is mandatory only when Traffic Shifting is enabled and Shift By is set to Percentage.

    Percentage of requests to be forwarded to the additional version.

    Rule Type

    This parameter is mandatory only when Traffic Shifting is enabled and Shift By is set to Rule.

    Select a pattern that meets the rule conditions.

    • All rules met: A request is sent to the additional version only when it meets all the rules in the rule list.
    • Any rule met: A request is sent to the additional version as long as it meets any rule in the rule list.

    Rules

    This parameter is mandatory only when Traffic Shifting is enabled and Shift By is set to Rule.

    Set the rule conditions that the function request must meet.

    • Parameter Type: The default value is Header, indicating the header parameter in an HTTP request.
    • Parameter: name of the header parameter in an HTTP request. The value is case insensitive.
    • Condition: condition type that the header parameter must meet. Options: = and in.
    • Value: value of the header parameter. The value is a character string.
      • If the condition is set to =, the condition is met only when the value of the header parameter in the request is the same as the specified value.
      • If the condition is set to in, you can set multiple values and separate them with commas (,). The condition is met when the value of the header parameter meets one of the values.

    Rule 1: Parameter is set to aaa, Condition is set to =, and Value is set to 123; Rule 2: Parameter is set to bbb, Condition is set to in, and Value is set to 111,222,333. If the HTTP request contains the header parameter aaa=123, rule 1 is met. If the HTTP request contains the header parameter bbb=222, rule 2 is met. If the HTTP request contains the header parameters aaa=123 and bbb=111, both rule 1 and rule 2 are met.

    Description

    Alias description. The value can contain up to 512 characters.

  4. Click OK. The alias function details page is displayed.
    Figure 1 Creating an alias

Managing Function Aliases

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the name of a function.
  3. On the function details page, select the latest version.
  4. On the Aliases tab, you can view the created aliases.
    • Click Edit on the right of an alias to modify the alias configuration.
      Figure 2 Modifying an Alias
    • Click Delete on the right of the alias. In the displayed dialog box, click OK.
      Figure 3 Deleting an Alias

Helpful Links

Manage function versions using APIs. For details, see Function Version and Alias APIs.