MultiCloud Classroom notes 28/Sep/2024

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
    Preview
  • Execute template Refer Here for changes done
    Preview
    Preview

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
    Preview
  • 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]
  }
}]

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Integration by Acurax Wordpress Developers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube