Closed khowling closed 3 years ago
You should be able to use the any() function like so:
resource aks_policies 'Microsoft.Authorization/policyAssignments@2019-09-01' = {
name: 'aks_policy_assignment'
location: location
properties: {
scope: aks.id
policyDefinitionId: policySetPodSecBaseline
parameters: {
excludedNamespaces: any('[ "kube-system", "gatekeeper-system", "azure-arc"]')
effect: any(azurepolicy)
}
}
}
Though @anthony-c-martin, I'm curious about the warning. Is that an issue with the swagger definition?
It seems like this resource type expects parameter values to be wrapped in an object with a value
key. Modifying the original report, that would be:
resource aks_policies 'Microsoft.Authorization/policyAssignments@2019-09-01' = {
name: 'aks_policy_assignment'
location: location
properties: {
scope: aks.id
policyDefinitionId: policySetPodSecBaseline
parameters: {
excludedNamespaces: {
value: '[ "kube-system", "gatekeeper-system", "azure-arc"]'
}
effect: {
value: azurepolicy
}
}
}
}
Awesome, thankyou @anthony-c-martin , thats fixed it!
Bicep CLI version 0.2.212 (a19d66c04c)
Wondering how to make this build warning go away
Warning BCP036: The property "excludedNamespaces" expected a value of type "ParameterValuesValue" but the provided value is of type "'[ "kube-system", "gatekeeper-system", "azure-arc"]'". /home/kehowli/projects/quest/aks-deploy-arm/main.bicep(522,15) : Warning BCP036: The property "effect" expected a value of type "ParameterValuesValue" but the provided value is of type "string".