A presentation at CodeMash 2023 in January 2023 in Sandusky, OH 44870, USA by Sam Gomez
ARM, Bicep, knees and toes! Infrastructure as code for beginners.
Originally from Mexico. Tech Lead at Geneca. Spend time with family, movies, videogames, soccer. @thesoccerdev drkclw samueljgomez
Agenda • Who is this talk for? • Infrastructure as Code • Azure Resource Manager • Tool overview • ARM templates • Bicep • Terraform
Who is this talk for? • People completely new to IaC. • Little experience with ARM templates. • New to Bicep. • New to Terraform.
Infrastructure as Code • Deploy infrastructure in an automated, consistent and repeatable manner.
Azure Resource Manager • API provisioning engine built into Azure.
Azure Resource Manager benefits • Manage infrastructure through templates. • Deploy resources in a consistent state. • Define dependencies between resources. • Apply tags to resources to organize them. • Apply access control.
ARM templates
ARM templates • JSON format with declarative syntax. • Defines infrastructure and configuration.
ARM Template format
ARM DEMO
https://www.rambli.com/2016/06/the-prayer-of-the-demo-gods/
Bicep
Bicep • Domain specific language that aims to drastically simplify authoring experience. • Transparent abstraction over ARM templates.
Bicep format
Bicep example
Modules • Allow you to use reference other bicep AND ARM template files. • Import modules from private or public registries.
Conditional (if) • Allow you to deploy resources only when condition is met.
Loops • Define multiple copies of: • • • • • Resources Modules Variables Properties Outputs
Loop over index
Loop over items
Loop over dictionary items
Loop over integer index and items
Loop over items with conditional
BICEP DEMO
Terraform
Terraform. • Open source IaC tool for provisioning and managing infrastructure. • HCL syntax. • Can provision resources to multiple cloud providers.
Terraform syntax. • Arguments. • Blocks.
Terraform state. • Terraform stores infrastructure state in a separate file.
TERRAFORM DEMO
Which one should I use?
Questions?
Useful links. • https://learn.microsoft.com/enus/azure/templates/. • https://github.com/Azure/azure-quickstarttemplates • https://github.com/Azure/bicep. • https://github.com/hashicorp/terraformprovider-azurerm/tree/main/examples.
@thesoccerdev drkclw samueljgomez
View ARM, Bicep, knees and toes! Infrastructure as code for beginners. on Notist.
Dismiss