Define template variables
Configure local variables
-
On the My Solutions page, find the desired template and click Edit Template. This example uses an ECS template.

-
Double-click the product icon to open the configuration dialog box. Properties that support variables are marked with an fx icon.

-
Click the fx icon to open the custom variable dialog box. The following table describes each configuration item.

Property
Description
Format
Requirements
Variable value
Set the variable name.
${variable_name}
-
The ${} format is fixed.
-
The variable name can contain only letters, numbers, hyphens (-), and underscores (_).
Placeholder
The placeholder format written to the architecture description file.
${variable_name} plus a combination of characters, such as 1-9 or A-Z.
This is usually the same as the variable value.
When you use a global variable, add the name of the global variable to the placeholder.
Default value
The default value for the variable. If you do not assign a value to the variable, the default value is used.
Default values are not supported for second-level properties.
-
-
Define variables for ECS properties, such as Quantity and Instance Name. Click the fx icon to the right of a property to set its custom variables.


When you configure local variables, the variable name and placeholder must be the same.
Configure global variables
You can use global variables to add the same variable across multiple instance types or in a multi-node deployment. For example, you can configure a global variable to add a common name prefix or suffix to all instances in the following template.

-
After you define the variables, find the template on the My Solutions page and click View Template Variables.

-
Click Add Global Variable in the upper-left corner. The configuration method is the same as for local variables.



-
Modify the local variable using a hyphen (-) to attach the global variable to the beginning or end of the local variable. Then, save the configuration.

ImportantBecause global variables are not attached to specific resource properties, they do not have placeholders. When you assign a global variable to a local variable, their data types must be the same.
-
Name of an instance created from a template


The hyphen (-) used in the global variable example can be replaced with any character or string that meets the instance naming conventions. The connecting character is retained when the variable is replaced.
View template variables
-
After you define the variables, find the template on the My Solutions page and click View Template Variables.

-
View the details of the defined template variables.
-
Variable Name: The name defined for the variable.
-
Default Value: The default value for the variable. This value is used if you do not assign another value.
-
Variable Type: The data type of the variable. This is important because it determines how you assign values to the variable.
-
Placeholder: The placeholder defined for the local variable.

-
Delete template variables
You can delete template variables in two ways:
-
Delete the variable in the View Template Variables dialog box.

-
In the variable definition dialog box, click Delete Current Variable.
