BCPNFR9 - Inputs - Decorators
ID: BCPNFR9 - Inputs - Decorators
Input parameters MUST have a @description() decorator. Mark sensitive string parameters, and parameters whose entire object value is sensitive, with @secure(). For objects that mix sensitive and non-sensitive properties, or arrays of objects with sensitive properties, follow BCPNFR21.
When a module passes an input to a secure child module parameter, a secure property of a child module input, or a secure resource property, you MUST also mark the source parameter or property @secure(). Do this at every step of the deployment: if you secure only the last input, the value stays unprotected at the earlier steps. Do not pass a @secure() value to a non-secure module or resource input. Leave non-sensitive values unmarked so you can pass them to non-secure inputs.
The Bicep linter rules use-secure-value-for-secure-inputs and no-secure-values-in-insecure-inputs report these mismatches as warnings in Bicep versions that support the checks. Follow this requirement even if the Bicep version used by AVM CI does not yet report the mismatch.
Further, input parameters SHOULD implement decorators like allowed, minValue, maxValue, minLength & maxLength (and others if available) as they have a big positive impact on the module’s usability.
@description('Optional. The threshold of your resource.')
@minValue(1)
@maxValue(10)
param threshold: int?
@description('Required. The SKU of your resource.')
@allowed([
'Basic'
'Premium'
'Standard'
])
param sku string