-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix vm validation, add multi lb scenarios (#85)
- Loading branch information
Showing
6 changed files
with
837 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
208 changes: 208 additions & 0 deletions
208
AzureBasicLoadBalancerUpgrade/testEnvs/scenarios/014-vmss-multi-lb-mix.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
targetScope = 'subscription' | ||
param randomGuid string = newGuid() | ||
param location string | ||
param resourceGroupName string | ||
|
||
|
||
// Resource Group | ||
module rg '../modules/Microsoft.Resources/resourceGroups/deploy.bicep' = { | ||
name: '${resourceGroupName}-${location}' | ||
params: { | ||
name: resourceGroupName | ||
location: location | ||
} | ||
} | ||
|
||
// vnet | ||
module virtualNetworks '../modules/Microsoft.Network/virtualNetworks/deploy.bicep' = { | ||
name: '${uniqueString(deployment().name)}-virtualNetworks' | ||
scope: resourceGroup(resourceGroupName) | ||
params: { | ||
// Required parameters | ||
location: location | ||
addressPrefixes: [ | ||
'10.0.0.0/16' | ||
] | ||
name: 'vnet-01' | ||
subnets: [ | ||
{ | ||
name: 'subnet-01' | ||
addressPrefix: '10.0.1.0/24' | ||
} | ||
] | ||
} | ||
dependsOn: [ | ||
rg | ||
] | ||
} | ||
|
||
// basic lb | ||
module loadbalancer01 '../modules/Microsoft.Network/loadBalancers_custom/deploy.bicep' = { | ||
name: 'lb-basic-01' | ||
scope: resourceGroup(resourceGroupName) | ||
params: { | ||
name: 'lb-basic-01' | ||
location: location | ||
frontendIPConfigurations: [ | ||
{ | ||
name: 'fe-01' | ||
subnetId: virtualNetworks.outputs.subnetResourceIds[0] | ||
} | ||
] | ||
backendAddressPools: [ | ||
{ | ||
name: 'be-01' | ||
} | ||
] | ||
inboundNatRules: [] | ||
loadBalancerSku: 'Basic' | ||
loadBalancingRules: [ | ||
{ | ||
backendAddressPoolName: 'be-01' | ||
backendPort: 80 | ||
frontendIPConfigurationName: 'fe-01' | ||
frontendPort: 80 | ||
idleTimeoutInMinutes: 4 | ||
loadDistribution: 'Default' | ||
name: 'rule-01' | ||
probeName: 'probe-01' | ||
protocol: 'Tcp' | ||
} | ||
] | ||
probes: [ | ||
{ | ||
intervalInSeconds: 5 | ||
name: 'probe-01' | ||
numberOfProbes: 2 | ||
port: '80' | ||
protocol: 'Tcp' | ||
} | ||
] | ||
} | ||
dependsOn: [ | ||
rg | ||
] | ||
} | ||
|
||
module publicIp01 '../modules/Microsoft.Network/publicIpAddresses/deploy.bicep' = { | ||
name: 'pip-01' | ||
params: { | ||
name: 'pip-01' | ||
location: location | ||
publicIPAddressVersion: 'IPv4' | ||
skuTier: 'Regional' | ||
skuName: 'Basic' | ||
publicIPAllocationMethod: 'Dynamic' | ||
} | ||
scope: resourceGroup(resourceGroupName) | ||
dependsOn: [ | ||
rg | ||
] | ||
} | ||
|
||
// basic lb | ||
module loadbalancer02 '../modules/Microsoft.Network/loadBalancers_custom/deploy.bicep' = { | ||
name: 'lb-basicext02' | ||
scope: resourceGroup(resourceGroupName) | ||
params: { | ||
name: 'lb-basic-02' | ||
location: location | ||
frontendIPConfigurations: [ | ||
{ | ||
name: 'fe-01' | ||
publicIPAddressId: publicIp01.outputs.resourceId | ||
} | ||
] | ||
backendAddressPools: [ | ||
{ | ||
name: 'be-01' | ||
} | ||
] | ||
inboundNatRules: [] | ||
loadBalancerSku: 'Basic' | ||
loadBalancingRules: [ | ||
{ | ||
backendAddressPoolName: 'be-01' | ||
backendPort: 80 | ||
frontendIPConfigurationName: 'fe-01' | ||
frontendPort: 80 | ||
idleTimeoutInMinutes: 4 | ||
loadDistribution: 'Default' | ||
name: 'rule-01' | ||
probeName: 'probe-01' | ||
protocol: 'Tcp' | ||
} | ||
] | ||
probes: [ | ||
{ | ||
intervalInSeconds: 5 | ||
name: 'probe-01' | ||
numberOfProbes: 2 | ||
port: '80' | ||
protocol: 'Tcp' | ||
} | ||
] | ||
} | ||
dependsOn: [ | ||
rg | ||
] | ||
} | ||
|
||
|
||
module virtualMachineScaleSets '../modules/Microsoft.Compute/virtualMachineScaleSets/deploy.bicep' = { | ||
name: 'vmss-01' | ||
scope: resourceGroup(resourceGroupName) | ||
params: { | ||
location: location | ||
// Required parameters | ||
encryptionAtHost: false | ||
adminUsername: 'admin-vmss' | ||
skuCapacity: 1 | ||
upgradePolicyMode: 'Manual' | ||
imageReference: { | ||
offer: 'WindowsServer' | ||
publisher: 'MicrosoftWindowsServer' | ||
sku: '2022-Datacenter' | ||
version: 'latest' | ||
} | ||
name: 'vmss-01' | ||
osDisk: { | ||
createOption: 'fromImage' | ||
diskSizeGB: '128' | ||
managedDisk: { | ||
storageAccountType: 'Standard_LRS' | ||
} | ||
} | ||
osType: 'Windows' | ||
skuName: 'Standard_DS1_v2' | ||
// Non-required parameters | ||
adminPassword: '${uniqueString(randomGuid)}rpP@340' | ||
nicConfigurations: [ | ||
{ | ||
ipConfigurations: [ | ||
{ | ||
name: 'ipconfig1' | ||
properties: { | ||
subnet: { | ||
id: virtualNetworks.outputs.subnetResourceIds[0] | ||
} | ||
loadBalancerBackendAddressPools: [ | ||
{ | ||
id: loadbalancer01.outputs.backendpools[0].id | ||
} | ||
{ | ||
id: loadbalancer02.outputs.backendpools[0].id | ||
} | ||
] | ||
} | ||
} | ||
] | ||
nicSuffix: '-nic-01' | ||
} | ||
] | ||
} | ||
dependsOn: [ | ||
rg | ||
] | ||
} | ||
|
Oops, something went wrong.