-
Notifications
You must be signed in to change notification settings - Fork 818
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
When creating a parameter, we can use @allowed(['a', 'b']) to specify allowed values.
Ideally, when a parameter is used in a resource or module where its parameter is also decorated with @allowed I would like to avoid repeating the list of allowed values, especially when the list is extensive.
@allowed(['Standard_RAGRS', 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS']) // I'm probably missing a few
param sku string
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: 'name'
sku: {
name: sku
}
// ...
}Describe the solution you'd like
An implicit or explicit way to copy the allowed values of a certain property.
Possible syntax:
@allowed(allowedOf(storageAccount.sku.name))
param sku string
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: 'name'
sku: {
name: sku
}
// ...
}This would allow the @allowed decorator to dynamically inherit the allowed values from the resource or module property, reducing redundancy and improving maintainability.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done