Variables and outputs¶
General¶
- All arguments should be made available as variables.
- All attributes should be made available as outputs.
Variable and output names¶
-
Variables should follow a common naming convention:
<resource>_<block>_<argument>
-
Outputs should follow a common naming convetion:
<resource>_<block>_<attribute>
Exception
Variable and output names that contain the module name. For example, in module
storage
the variablestorage_account_name
should be namedaccount_name
instead.
Variable and output descriptions¶
- Use description to describe the values of variables and outputs.
-
If valid variable values is known:
-
If set of valid values is known, append to description:
Value must be X or Y.
Else, if range of valid values is known, append to description:
Value must be between X and Y.
Else, if subset of valid values is known, append to description:
Possible values include X, Y and Z.
Else, if format of valid values is known, append to description:
Value must be in F format, e.g. X, Y and Z.
-
Add custom validation rules to check if variable value is valid.
-
Variable and output types¶
-
Use simple types (
string
,number
andbool
) over complex types (list
,object
andmap
) for variables and outputs where possible:Rationale
Variables and outputs of simpler types are easier to write good descriptions for. For example, it's easier to write a good description for a simple
string
than for anobject
with multiplestring
properties. It's also easier for a user to pass a simplestring
to a variable than to construct and pass a complexobject
.