Skip to content

Commit

Permalink
updated bicep api versions
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlabs committed Aug 30, 2023
1 parent 5051c8a commit f60885b
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 39 deletions.
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@2022-12-01' existing = {
name: acrName
}

Expand Down
2 changes: 1 addition & 1 deletion bicep/aksagentpool.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ 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-05-01' existing = {
name: AksName
}

Expand Down
2 changes: 1 addition & 1 deletion bicep/aksnetcontrib.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var existingAksPodSubnetName = !empty(byoAKSPodSubnetId) ? split(byoAKSPodSubnet
var existingAksSubnetName = !empty(byoAKSSubnetId) ? split(byoAKSSubnetId, '/')[10] : ''
var existingAksVnetName = !empty(byoAKSSubnetId) ? split(byoAKSSubnetId, '/')[8] : ''

resource existingvnet 'Microsoft.Network/virtualNetworks@2022-07-01' existing = {
resource existingvnet 'Microsoft.Network/virtualNetworks@2023-04-01' existing = {
name: existingAksVnetName
}
resource existingAksSubnet 'Microsoft.Network/virtualNetworks/subnets@2022-07-01' existing = {
Expand Down
10 changes: 5 additions & 5 deletions bicep/appgw.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ param appGWmaxCount int
var appgwName = 'agw-${resourceName}'
var appgwResourceId = resourceId('Microsoft.Network/applicationGateways', '${appgwName}')

resource appgwpip 'Microsoft.Network/publicIPAddresses@2020-07-01' = {
resource appgwpip 'Microsoft.Network/publicIPAddresses@2023-04-01' = {
name: 'pip-agw-${resourceName}'
location: location
sku: {
Expand Down Expand Up @@ -131,7 +131,7 @@ var appGwZones = !empty(availabilityZones) ? availabilityZones : []

// 'identity' is always set until this is fixed:
// https://github.com/Azure/bicep/issues/387#issuecomment-885671296
resource appgw 'Microsoft.Network/applicationGateways@2020-07-01' = if (!empty(userAssignedIdentity)) {
resource appgw 'Microsoft.Network/applicationGateways@2023-04-01' = if (!empty(userAssignedIdentity)) {
name: appgwName
location: location
zones: appGwZones
Expand All @@ -147,7 +147,7 @@ resource appgw 'Microsoft.Network/applicationGateways@2020-07-01' = if (!empty(u
param agicPrincipleId string
var contributor = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
// https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal
resource appGwAGICContrib 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
resource appGwAGICContrib 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: appgw
name: guid(resourceGroup().id, appgwName, 'appgwcont')
properties: {
Expand All @@ -158,7 +158,7 @@ resource appGwAGICContrib 'Microsoft.Authorization/roleAssignments@2020-04-01-pr
}

var reader = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
resource appGwAGICRGReader 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
resource appGwAGICRGReader 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: resourceGroup()
name: guid(resourceGroup().id, appgwName, 'rgread')
properties: {
Expand Down Expand Up @@ -189,7 +189,7 @@ var diagProperties = {
}
]
}
resource appgw_Diag 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (!empty(workspaceId)) {
resource appgw_Diag 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if (!empty(workspaceId)) {
scope: appgw
name: 'appgwDiag'
properties: diagProperties
Expand Down
2 changes: 1 addition & 1 deletion bicep/automationrunbook/aksRbac.bicep
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
param principalId string
param aksName string

resource aks 'Microsoft.ContainerService/managedClusters@2023-03-02-preview' existing = {
resource aks 'Microsoft.ContainerService/managedClusters@2023-05-01' existing = {
name: aksName
}

Expand Down
2 changes: 1 addition & 1 deletion bicep/automationrunbook/automation.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ resource automationAccount 'Microsoft.Automation/automationAccounts@2022-08-08'
}
}

resource automationAccountDiagLogging 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if(!empty(loganalyticsWorkspaceId)) {
resource automationAccountDiagLogging 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if(!empty(loganalyticsWorkspaceId)) {
name: 'diags'
scope: automationAccount
properties: {
Expand Down
10 changes: 5 additions & 5 deletions bicep/firewall.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var managementIpConfig = {
}
}

resource fw_pip 'Microsoft.Network/publicIPAddresses@2022-07-01' = {
resource fw_pip 'Microsoft.Network/publicIPAddresses@2023-04-01' = {
name: firewallPublicIpName
location: location
sku: {
Expand All @@ -38,7 +38,7 @@ resource fw_pip 'Microsoft.Network/publicIPAddresses@2022-07-01' = {
}
}

resource fwManagementIp_pip 'Microsoft.Network/publicIPAddresses@2022-07-01' = if(fwSku=='Basic') {
resource fwManagementIp_pip 'Microsoft.Network/publicIPAddresses@2023-04-01' = if(fwSku=='Basic') {
name: firewallManagementPublicIpName
location: location
sku: {
Expand All @@ -51,7 +51,7 @@ resource fwManagementIp_pip 'Microsoft.Network/publicIPAddresses@2022-07-01' = i
}
}

resource fwDiags 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (!empty(workspaceDiagsId)) {
resource fwDiags 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if (!empty(workspaceDiagsId)) {
scope: fw
name: 'fwDiags'
properties: {
Expand Down Expand Up @@ -91,7 +91,7 @@ resource fwDiags 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if
param appDnsZoneName string = ''

var fw_name = 'afw-${resourceName}'
resource fw 'Microsoft.Network/azureFirewalls@2022-01-01' = {
resource fw 'Microsoft.Network/azureFirewalls@2023-04-01' = {
name: fw_name
location: location
zones: !empty(availabilityZones) ? availabilityZones : []
Expand Down Expand Up @@ -122,7 +122,7 @@ resource fw 'Microsoft.Network/azureFirewalls@2022-01-01' = {
}
}

resource fwPolicy 'Microsoft.Network/firewallPolicies@2022-01-01' = {
resource fwPolicy 'Microsoft.Network/firewallPolicies@2023-04-01' = {
name: 'afwp-${resourceName}'
location: location
properties: {
Expand Down
2 changes: 1 addition & 1 deletion bicep/keyvault.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resource kv 'Microsoft.KeyVault/vaults@2022-07-01' = {
}
}

resource kvDiags 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (!empty(logAnalyticsWorkspaceId)) {
resource kvDiags 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if (!empty(logAnalyticsWorkspaceId)) {
name: 'kvDiags'
scope: kv
properties: {
Expand Down
22 changes: 11 additions & 11 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@2022-12-01' = if (!empty(registries_sku)) {
name: acrName
location: location
sku: {
Expand Down Expand Up @@ -449,7 +449,7 @@ output containerRegistryName string = !empty(registries_sku) ? acr.name : ''
output containerRegistryId string = !empty(registries_sku) ? acr.id : ''


resource acrDiags 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (createLaw && !empty(registries_sku)) {
resource acrDiags 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if (createLaw && !empty(registries_sku)) {
name: 'acrDiags'
scope: acr
properties: {
Expand Down Expand Up @@ -622,7 +622,7 @@ resource appGwIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01
var appgwName = 'agw-${resourceName}'
var appgwResourceId = deployAppGw ? resourceId('Microsoft.Network/applicationGateways', '${appgwName}') : ''

resource appgwpip 'Microsoft.Network/publicIPAddresses@2022-07-01' = if (deployAppGw) {
resource appgwpip 'Microsoft.Network/publicIPAddresses@2023-04-01' = if (deployAppGw) {
name: 'pip-agw-${resourceName}'
location: location
sku: {
Expand Down Expand Up @@ -761,7 +761,7 @@ var appgwProperties = union({
} : {})

// 'identity' is always set until this is fixed: https://github.com/Azure/bicep/issues/387#issuecomment-885671296
resource appgw 'Microsoft.Network/applicationGateways@2022-07-01' = if (deployAppGw) {
resource appgw 'Microsoft.Network/applicationGateways@2023-04-01' = if (deployAppGw) {
name: appgwName
location: location
zones: !empty(availabilityZones) ? availabilityZones : []
Expand Down Expand Up @@ -812,7 +812,7 @@ resource appGwAGICMIOp 'Microsoft.Authorization/roleAssignments@2022-04-01' = if
}

// AppGW Diagnostics
resource appgw_Diag 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (createLaw && deployAppGw) {
resource appgw_Diag 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if (createLaw && deployAppGw) {
scope: appgw
name: 'appgwDiag'
properties: {
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-05-01' = {
name: 'aks-${resourceName}'
location: location
properties: aksProperties
Expand Down Expand Up @@ -1532,7 +1532,7 @@ param AksDiagCategories array = [
@description('Enable SysLogs and send to log analytics')
param enableSysLog bool = false

resource AksDiags 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (createLaw && omsagent) {
resource AksDiags 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if (createLaw && omsagent) {
name: 'aksDiags'
scope: aks
properties: {
Expand All @@ -1550,7 +1550,7 @@ resource AksDiags 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' =
}
}

resource sysLog 'Microsoft.Insights/dataCollectionRules@2022-06-01' = if (createLaw && omsagent && enableSysLog) {
resource sysLog 'Microsoft.Insights/dataCollectionRules@2021-04-01' = if (createLaw && omsagent && enableSysLog) {
name: 'MSCI-${location}-${aks.name}'
location: location
kind: 'Linux'
Expand Down Expand Up @@ -1633,7 +1633,7 @@ resource sysLog 'Microsoft.Insights/dataCollectionRules@2022-06-01' = if (create
}
}

resource association 'Microsoft.Insights/dataCollectionRuleAssociations@2022-06-01' = if (createLaw && omsagent && enableSysLog) {
resource association 'Microsoft.Insights/dataCollectionRuleAssociations@2021-04-01' = if (createLaw && omsagent && enableSysLog) {
name: '${aks.name}-${aks_law.name}-association'
scope: aks
properties: {
Expand Down Expand Up @@ -1739,7 +1739,7 @@ output LogAnalyticsId string = (createLaw) ? aks_law.id : ''
@description('Create an Event Grid System Topic for AKS events')
param createEventGrid bool = false

resource eventGrid 'Microsoft.EventGrid/systemTopics@2021-12-01' = if(createEventGrid) {
resource eventGrid 'Microsoft.EventGrid/systemTopics@2022-06-15' = if(createEventGrid) {
name: 'evgt-${aks.name}'
location: location
identity: {
Expand All @@ -1753,7 +1753,7 @@ resource eventGrid 'Microsoft.EventGrid/systemTopics@2021-12-01' = if(createEven

output eventGridName string = createEventGrid ? eventGrid.name : ''

resource eventGridDiags 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (createLaw && createEventGrid) {
resource eventGridDiags 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if (createLaw && createEventGrid) {
name: 'eventGridDiags'
scope: eventGrid
properties: {
Expand Down
18 changes: 9 additions & 9 deletions bicep/network.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ var fwmgmt_subnet = {
}

var routeFwTableName = 'rt-afw-${resourceName}'
resource vnet_udr 'Microsoft.Network/routeTables@2022-07-01' = if (azureFirewalls) {
resource vnet_udr 'Microsoft.Network/routeTables@2023-04-01' = if (azureFirewalls) {
name: routeFwTableName
location: location
properties: {
Expand Down Expand Up @@ -206,7 +206,7 @@ var subnets = union(
output debugSubnets array = subnets

var vnetName = 'vnet-${resourceName}'
resource vnet 'Microsoft.Network/virtualNetworks@2022-07-01' = {
resource vnet 'Microsoft.Network/virtualNetworks@2023-04-01' = {
name: vnetName
location: location
properties: {
Expand Down 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 @@ -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 @@ -361,7 +361,7 @@ var publicIpAddressName = 'pip-${bastionHostName}'
])
param bastionSku string = 'Standard'

resource bastionPip 'Microsoft.Network/publicIPAddresses@2022-07-01' = if(bastion) {
resource bastionPip 'Microsoft.Network/publicIPAddresses@2023-04-01' = if(bastion) {
name: publicIpAddressName
location: location
sku: {
Expand All @@ -373,7 +373,7 @@ resource bastionPip 'Microsoft.Network/publicIPAddresses@2022-07-01' = if(bastio
}
}

resource bastionHost 'Microsoft.Network/bastionHosts@2022-11-01' = if(bastion) {
resource bastionHost 'Microsoft.Network/bastionHosts@2023-04-01' = if(bastion) {
name: bastionHostName
location: location
sku: {
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@2022-09-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
2 changes: 1 addition & 1 deletion bicep/networkwatcherflowlog.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ param workspaceId string = ''
param workspaceResourceId string = ''
param workspaceRegion string = resourceGroup().location

resource networkWatcher 'Microsoft.Network/networkWatchers@2022-01-01' = {
resource networkWatcher 'Microsoft.Network/networkWatchers@2023-04-01' = {
name: 'NetworkWatcher_${location}'
location: location
properties: {}
Expand Down
4 changes: 2 additions & 2 deletions bicep/nsg.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param workspaceRegion string = resourceGroup().location

var nsgName = 'nsg-${resourceName}'

resource nsg 'Microsoft.Network/networkSecurityGroups@2022-11-01' = {
resource nsg 'Microsoft.Network/networkSecurityGroups@2023-04-01' = {
name: nsgName
location: location
}
Expand Down Expand Up @@ -243,7 +243,7 @@ param NsgDiagnosticCategories array = [
'NetworkSecurityGroupRuleCounter'
]

resource nsgDiags 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (!empty(workspaceResourceId)) {
resource nsgDiags 'Microsoft.Insights/diagnosticSettings@2016-09-01' = if (!empty(workspaceResourceId)) {
name: 'diags-${nsgName}'
scope: nsg
properties: {
Expand Down

0 comments on commit f60885b

Please sign in to comment.