Closed jgardner04 closed 3 months ago
It looks like the issue is here The location should be set to a parameter, the default value of the parameter can be resourceGroup().location
it would look like
param location string = resourceGroup().location
resource DefAKSAssignment 'Microsoft.Authorization/policyAssignments@2021-06-01' = if (environment().name == 'AzureCloud') {
name: 'EnableDefenderForAKS'
location: location
...
}
I will work up a fix and get a PR in as soon as I can.
In testing the deployment ran into additional linting issues with the policy.bicep
file. The linter is throwing an additional error that the policyDefinitionId
needs to be in a parameter as well. I will update the PR with this after testing.
Describe the bug When running the Deploy Enterprise Landing Zone Hub & Spoke Infrastructure via the GitHub Action I get an error in the Deploy AKS in Spoke. The error is outlined below.
Error: WARNING: /home/runner/work/AKS-Landing-Zone-Accelerator/AKS-Landing-Zone-Accelerator/Scenarios/AKS-Secure-Baseline-PrivateCluster/Bicep/06-AKS-cluster/modules/policy/policy.bicep(3,13) : Warning no-loc-expr-outside-params: Use a parameter here instead of 'resourceGroup().location'. 'resourceGroup().location' and 'deployment().location' should only be used as a default value for parameters.
The error is coming from the Bicep Linter
no-loc-expr-outside-params
rule.To Reproduce Steps to reproduce the behavior:
Expected behavior The GH Action would complete, and the infrastructure would be deployed.
Additional context The fork is up to date with commit e1090f0.