Global variable groups

Updated at:

Apsara DevOps AppStack offers enterprise-level global variable groups. You can use these groups to render application environment orchestrations and to build and deploy development flows.

Manage global variable groups

Create a global variable group

In AppStack, choose Global Settings > Other Settings > Global Variable Groups. Then, click Create Variable Group.

  • Enter a Name and Display Name for the variable group. Click OK to create the global variable group.

Edit a global variable group

In AppStack, choose Global Settings > Other Settings > Global Variable Groups. Click the target variable group to open its details page. Then, click Edit Variables.

  • Enter variable names and variable values in bulk using the key = value format. Use the # symbol to add descriptions.

  • Click Save. You can preview the changes to the variables. Enter a change log and click Submit to save the changes.

Set member permissions for a variable group

Global variable groups allow you to add members and set role permissions. The available roles and their permissions are as follows:

  • Owner: Has all permissions for the global variable group, including viewing, using, editing, and deleting the group. The Owner role can be transferred.

  • Administrator: Can view, use, edit, and delete the variable group.

  • User: Can only view and use the variable group.

In AppStack, choose Global Settings > Other Settings > Global Variable Groups. Click the target variable group to open its details page. Click Member Management to add members or modify member role permissions.

Variable group version history

AppStack records the version history of global variable groups. You can compare the differences between versions. In AppStack, choose Global Settings > Other Settings > Global Variable Groups. Click the target variable group to open its details page. Click Version History to view the group's version history.

Delete a global variable group

In AppStack, choose Global Settings > Other Settings > Global Variable Groups. Click the target variable group to open its details page. Click Delete Variable Group. Because a deleted variable group cannot be recovered, proceed with caution. Variable groups that are associated with applications or templates cannot be deleted.

Use global variable groups

Use global variable groups in environment deployments

In the application environment settings, you can associate variable groups to dynamically replace referenced variables in the application orchestration during deployment. This process renders the deployment YAML file or deployment script. An environment can be associated with multiple variable groups or global variable groups. If the same key exists in multiple groups, the value from the last associated group overwrites the values from the preceding groups.

  • Associate the application's development environment variable group with the global development environment variable group. In this example, both groups contain the same key.

  • After you complete the configuration, deploy the environment. The value for the key from the last associated variable group is used. For more information, see how variable groups work.

Use global variable groups in development flows

In the application settings, you can associate variable groups in the development flow configuration. These groups are used to dynamically replace referenced variables in the pipeline at runtime. A development flow stage can be associated with multiple variable groups or global variable groups. If the same key exists in multiple groups, the value from the last associated group overwrites the values from the preceding groups.

  • Associate the application's development environment variable group with the global development environment variable group. In this example, both groups contain the same key.

  • You can view the variables that are configured in the pipeline for the development flow.

  • In the application's development flow, select the stage and click Run to trigger the pipeline. Click Logs to view the logs. The value for the key from the last associated variable group is used.