Bicep modules MAY provide parameter input examples for parameters using the metadata.example property via the @metadata() decorator.
Example:
@metadata({example:'uksouth'})@description('Optional. Location for all resources.')paramlocationstring=resourceGroup().location@metadata({example:'''
{
keyName: 'myKey'
keyVaultResourceId: '/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/my-rg/providers/Microsoft.KeyVault/vaults/myvault'
keyVersion: '6d143c1a0a6a453daffec4001e357de0'
userAssignedIdentityResourceId '/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity'
}
'''})@description('Optional. The customer managed key definition.')paramcustomerManagedKeycustomerManagedKeyType
It is planned that these examples are automatically added to the module readme’s parameter descriptions when running either the Set-ModuleReadMe or Set-AVMModule scripts (available in the utilities folder).
README documentation MUST be automatically/programmatically generated. MUST include the sections as defined in the language specific requirements
BCPNFR2
,
TFNFR2
.
Where descriptions for variables and outputs spans multiple lines. The description MAY provide variable input examples for each variable using the HEREDOC format and embedded markdown.
Example:
variable"my_complex_input"{type = map(object({param1 = stringparam2 = optional(number,null)}))description = <<DESCRIPTIONA complex input variable that is a map of objects.
Each object has two attributes:
- `param1`: A required string parameter.
- `param2`: (Optional) An optional number parameter.
Example Input:
```terraform
my_complex_input = {
"object1" = {
param1 = "value1"
param2 = 2
}
"object2" = {
param1 = "value2"
}
}
```
DESCRIPTION}