Cloudformation
- we write templates and to execute the template we create stack
- components
- resources
- parameters
- outputs
- LEts create a vpc with 2 subnets and two ec2 instances
- Execute template Refer Here for changes done
ARM (Azure Resoure Manager) Templates
- Refer Here for the extension to vscode
- Refer Here for creating arm templates from vscode
- Refer Here for ARM Template reference
- Refer Here for resource manager
- ARM templates are written in json format Refer Here for sample template with network and two subnets
- Azure Bicep is a new format for deploying templates with dsl
param location string = resourceGroup().location
param networkCidr string = '10.0.0.0/16'
param subnetCidrs array = [
'10.0.0.0/24'
'10.0.1.0/24'
'10.0.2.0/24'
]
param subnetNames array = [
'web'
'app'
'db'
]
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-11-01' = {
name: 'network'
location: location
properties: {
addressSpace: {
addressPrefixes: [
networkCidr
]
}
}
}
resource subnets 'Microsoft.Network/virtualNetworks/subnets@2023-11-01' = [for (cidr, index) in subnetCidrs: {
name: subnetNames[index]
properties: {
addressPrefix: subnetCidrs[index]
}
}]
