ARM, Bicep, knees and toes! Infrastructure as code for beginners.

A presentation at Dev Space Technical Conference in October 2023 in Huntsville, AL, USA by Sam Gomez

Slide 1

Slide 1

ARM, Bicep, knees and toes! Infrastructure as code for beginners.

Slide 2

Slide 2

Originally from Mexico. Tech Lead at Geneca. Spend time with family, movies, videogames, soccer. @thesoccerdev drkclw samueljgomez

Slide 3

Slide 3

Agenda • Who is this talk for? • Infrastructure as Code • Tool overview • ARM templates • Bicep • Terraform

Slide 4

Slide 4

Who is this talk for? • People completely new to IaC. • Little experience with ARM templates. • New to Bicep. • New to Terraform.

Slide 5

Slide 5

Infrastructure as Code • Deploy infrastructure in an automated, consistent and repeatable manner.

Slide 6

Slide 6

ARM templates

Slide 7

Slide 7

ARM templates • JSON format with declarative syntax. • Defines infrastructure and configuration.

Slide 8

Slide 8

ARM Template format

Slide 9

Slide 9

ARM DEMO

Slide 10

Slide 10

https://www.rambli.com/2016/06/the-prayer-of-the-demo-gods/

Slide 11

Slide 11

Bicep

Slide 12

Slide 12

Bicep • Domain specific language that aims to drastically simplify authoring experience. • Transparent abstraction over ARM templates.

Slide 13

Slide 13

Bicep format

Slide 14

Slide 14

Modules • Allow you to use reference other bicep AND ARM template files. • Import modules from private or public registries.

Slide 15

Slide 15

Conditional (if) • Allow you to deploy resources only when condition is met.

Slide 16

Slide 16

Loops • Define multiple copies of: • • • • • Resources Modules Variables Properties Outputs

Slide 17

Slide 17

Loop over index

Slide 18

Slide 18

Loop over items

Slide 19

Slide 19

Loop over dictionary items

Slide 20

Slide 20

Loop over integer index and items

Slide 21

Slide 21

Loop over items with conditional

Slide 22

Slide 22

BICEP DEMO

Slide 23

Slide 23

Terraform

Slide 24

Slide 24

Terraform. • Open source IaC tool for provisioning and managing infrastructure. • HCL syntax. • Can provision resources to multiple cloud providers.

Slide 25

Slide 25

Terraform providers. • Plugins used to interact with cloud providers, SaaS providers and other APIs. • Azure • AWS • Google Cloud

Slide 26

Slide 26

Terraform syntax. • Arguments. • Blocks.

Slide 27

Slide 27

Modules • Containers for multiple resources. • Terraform registry hosts publicly available modules.

Slide 28

Slide 28

Terraform state. • Terraform stores infrastructure state in a separate file.

Slide 29

Slide 29

TERRAFORM DEMO

Slide 30

Slide 30

Which one should I use?

Slide 31

Slide 31

Terraform. • Resources not in Azure (including onprem). • Mix of cloud providers. • More accessible for developers.

Slide 32

Slide 32

Bicep. • Resources in Azure only. • Share templates via registries. • More accessible to developers.

Slide 33

Slide 33

ARM. • Resources in Azure only. • Do not want to learn new language. • Team has experience with ARM templates.

Slide 34

Slide 34

Questions?

Slide 35

Slide 35

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.

Slide 36

Slide 36

Useful links. • https://github.com/Azure/bicep-registrymodules/tree/main/modules

Slide 37

Slide 37

@thesoccerdev drkclw samueljgomez