Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bicep and Terraform Code generation (without AI...

Bicep and Terraform Code generation (without AI) by Thomas Hafermalz

Don't find the right example for your cloud service you want to deploy with infrastructure as code in the official documentation or tech forums? No co-pilot available or with unsatisfying results? This session shows with hands-on demos, how you can "generate" code for your cloud infrastracture with Visual Studio Code and some extensions & tools. It has examples for Bicep, ARM and Terraform - without any co-pilot.

About Thomas:
I support customers from various industries in Azure projects. Besides I blog / write articles on Azure topics and co-organize the Azure Zurich User group on meetup.

https://www.linkedin.com/in/thomashafermalz/
https://thomashafermalz.net/

Azure Zurich User Group

October 03, 2024
Tweet

More Decks by Azure Zurich User Group

Other Decks in Technology

Transcript

  1. THOMAS HAFERMALZ  Azure Solution Architect & Trainer (Zurich, )

     Study: Industrial Environmental Informatics  Meetup: Azure Zurich User Group www.thomashafermalz.net www.linkedin.com/in/thomashafermalz
  2. ▪ Repeat your steps ▪Idempotence / declaration ▪Easier deployment across

    stages ▪Reproducibility / consistency ▪ Repositories ▪Traceability ▪Versioning ▪Teamwork BENEFITS OF IAC:
  3. ▪ Create from scratch ▪examples from documentation ▪Stackoverflow etc… ▪Where

    is MY usecase??? ▪ Existing templates in other language CHALLENGES (GET THE CODE)
  4. ▪ Generate parameter files ▪ Import as Bicep code per

    resource ID ▪ Convert Bicep <-> ARM ▪Existing templates / snippets ▪ Helpful: Deployment Pane (experimental) ▪No bicepparam files atm BICEP OPTIONS
  5. ▪ VS Code ▪Extensions ▪Bicep ▪Azure CLI (scrapbooks) / Powershell

    ▪ Bicep CLI ▪Incl. in Azure CLI, additional needed for PowerShell WHAT DO I NEED?
  6. ▪ Write code from existing infrastructure ▪Portal created ▪ No

    change / redeploy of resources (production) ▪State import BACKGROUND
  7. ▪ Import Block & config generate ▪Terraform v1.5 ▪ https://developer.hashicorp.com/terraform/language/import/generating-configuration

    ▪ Tf export tool («Terrafy») ▪Generate HCL incl. statefile ▪Various filter options for scope ▪Only Azure resources TERRAFORM OPTIONS 1
  8. ▪ Import from state ▪View on resource configuration (diagnostic tables)

    ▪ Azure portal export(soon) ▪ Other tools ▪Terraformer (GCP) and terracognita ▪Terraforming (AWS) TERRAFORM OPTIONS 2
  9. ▪ Features ▪Import complete RG with/without statefile ▪Interactive/automatic ▪Edit resource

    mapping ▪ Filters (query) ▪Single resource ▪Resource type (provider) ▪tags TERRAFORM EXPORT TOOL
  10. ▪ VS Code ▪Terraform runtime ▪Extensions ▪HashiCorp Terraform / Azure

    Terraform ▪Azure CLI (scrapbooks) / Powershell ▪ TF Export Tool ▪https://github.com/Azure/aztfexport/releases WHAT DO I NEED?
  11. ▪ Available set of modules supported by Microsoft ▪ For

    Bicep & Terraform ▪https://azure.github.io/Azure-Verified-Modules/ ▪'br/public:avm/res/network/virtual-network:<version>' AZURE VERIFIED MODULES (AVM)