Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bicep linter warnings for Bicep 0.20.4 #647

Merged
merged 6 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bicep/acragentpool.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ param location string = resourceGroup().location
param acrName string
param acrPoolSubnetId string = ''

resource acr 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = {
resource acr 'Microsoft.ContainerRegistry/registries@2023-07-01' existing = {
name: acrName
}

Expand Down
4 changes: 2 additions & 2 deletions bicep/aksagentpool.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ param autoTaintWindows bool = false

var taints = autoTaintWindows ? union(nodeTaints, ['sku=Windows:NoSchedule']) : nodeTaints

resource aks 'Microsoft.ContainerService/managedClusters@2021-10-01' existing = {
resource aks 'Microsoft.ContainerService/managedClusters@2023-08-02-preview' existing = {
name: AksName
}

resource userNodepool 'Microsoft.ContainerService/managedClusters/agentPools@2021-10-01' = {
resource userNodepool 'Microsoft.ContainerService/managedClusters/agentPools@2023-08-02-preview' = {
parent: aks
name: PoolName
properties: {
Expand Down
6 changes: 6 additions & 0 deletions bicep/bicepconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"enabled": true,
"verbose": false,
"rules": {
"prefer-unquoted-property-names" : {
"level": "warning"
},
"use-parent-property" : {
"level": "warning"
},
"use-recent-api-versions" : {
"level": "warning"
},
Expand Down
7 changes: 4 additions & 3 deletions bicep/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ param acrUntaggedRetentionPolicy int = 30

var acrName = 'cr${replace(resourceName, '-', '')}${uniqueString(resourceGroup().id, resourceName)}'

resource acr 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' = if (!empty(registries_sku)) {
resource acr 'Microsoft.ContainerRegistry/registries@2023-07-01' = if (!empty(registries_sku)) {
name: acrName
location: location
sku: {
Expand Down Expand Up @@ -1336,7 +1336,7 @@ keyVaultKmsCreateAndPrereqs || !empty(keyVaultKmsByoKeyId) ? azureKeyVaultKms :
!empty(serviceMeshProfile) ? { serviceMeshProfile: serviceMeshProfileObj } : {}
)

resource aks 'Microsoft.ContainerService/managedClusters@2023-05-02-preview' = {
resource aks 'Microsoft.ContainerService/managedClusters@2023-06-01' = {
name: 'aks-${resourceName}'
location: location
properties: aksProperties
Expand Down Expand Up @@ -1786,7 +1786,8 @@ var telemetryId = '3c1e2fc6-1c4b-44f9-8694-25d00ae30a3a-${location}'
|__| |_______||_______||_______||__| |__| |_______| |__| | _| `._____| |__| |_______/ |_______|| _| |_______| \______/ |__| |__| |__| |_______||__| \__| |__| */

// Telemetry Deployment
resource telemetrydeployment 'Microsoft.Resources/deployments@2022-09-01' = if (enableTelemetry) {
#disable-next-line no-deployments-resources
resource telemetrydeployment 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: telemetryId
properties: {
mode: 'Incremental'
Expand Down
14 changes: 7 additions & 7 deletions bicep/network.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ module aks_vnet_con 'networksubnetrbac.bicep' = if (!empty(aksPrincipleId)) {

/* -------------------------------------------------------------------------- Private Link for ACR */
var privateLinkAcrName = 'pl-acr-${resourceName}'
resource privateLinkAcr 'Microsoft.Network/privateEndpoints@2021-08-01' = if (!empty(privateLinkAcrId)) {
resource privateLinkAcr 'Microsoft.Network/privateEndpoints@2023-04-01' = if (!empty(privateLinkAcrId)) {
name: privateLinkAcrName
location: location
properties: {
Expand Down Expand Up @@ -279,7 +279,7 @@ resource privateDnsAcrLink 'Microsoft.Network/privateDnsZones/virtualNetworkLink
}
}

resource privateDnsAcrZoneGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2021-08-01' = if (!empty(privateLinkAcrId)) {
resource privateDnsAcrZoneGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2023-04-01' = if (!empty(privateLinkAcrId)) {
parent: privateLinkAcr
name: 'default'
properties: {
Expand All @@ -297,7 +297,7 @@ resource privateDnsAcrZoneGroup 'Microsoft.Network/privateEndpoints/privateDnsZo

/* -------------------------------------------------------------------------- Private Link for KeyVault */
var privateLinkAkvName = 'pl-akv-${resourceName}'
resource privateLinkAkv 'Microsoft.Network/privateEndpoints@2021-08-01' = if (!empty(privateLinkAkvId)) {
resource privateLinkAkv 'Microsoft.Network/privateEndpoints@2023-04-01' = if (!empty(privateLinkAkvId)) {
name: privateLinkAkvName
location: location
properties: {
Expand Down Expand Up @@ -337,7 +337,7 @@ resource privateDnsAkvLink 'Microsoft.Network/privateDnsZones/virtualNetworkLink
}
}

resource privateDnsAkvZoneGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2021-08-01' = if (!empty(privateLinkAkvId)) {
resource privateDnsAkvZoneGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2023-04-01' = if (!empty(privateLinkAkvId)) {
parent: privateLinkAkv
name: 'default'
properties: {
Expand Down Expand Up @@ -405,7 +405,7 @@ resource log 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = if
param CreateNsgFlowLogs bool = false

var flowLogStorageName = take(replace(toLower('stflow${resourceName}${uniqueString(resourceGroup().id, resourceName)}'),'-',''),24)
resource flowLogStor 'Microsoft.Storage/storageAccounts@2021-08-01' = if(CreateNsgFlowLogs && networkSecurityGroups) {
resource flowLogStor 'Microsoft.Storage/storageAccounts@2023-01-01' = if(CreateNsgFlowLogs && networkSecurityGroups) {
name: flowLogStorageName
kind: 'StorageV2'
sku: {
Expand Down Expand Up @@ -505,7 +505,7 @@ module nsgPrivateLinks 'nsg.bicep' = if(privateLinks && networkSecurityGroups) {
]
}

resource natGwIp 'Microsoft.Network/publicIPAddresses@2021-08-01' = [for i in range(0, natGatewayPublicIps): if(natGateway) {
resource natGwIp 'Microsoft.Network/publicIPAddresses@2023-04-01' = [for i in range(0, natGatewayPublicIps): if(natGateway) {
name: 'pip-${natGwName}-${i+1}'
location: location
sku: {
Expand All @@ -521,7 +521,7 @@ output natGwIpArr array = [for i in range(0, natGatewayPublicIps): natGateway ?

var natGwName = 'ng-${resourceName}'

resource natGw 'Microsoft.Network/natGateways@2021-08-01' = if(natGateway) {
resource natGw 'Microsoft.Network/natGateways@2023-04-01' = if(natGateway) {
name: natGwName
location: location
sku: {
Expand Down
Loading