Infrastructure as Code is essential, if you want to rely on sustainable, fast, and reproducible deployments across multiple cloud platforms. In this workshop, we will explore how to automate the deployment of resources using Terraform. Not very experienced or a beginner? No problem, we will go through the concepts of Terraform from scratch together and write the code piece by piece. The final goal is to create your first Terraform configuration, and to conduct the corresponding commands to deploy the resources. Terraform can be used to create, change, and to destroy resources across different cloud providers, the dedicated code for that will be written in HCL (HashiCorp Configuration Language). Each cloud provider defines their own APIs and models of the resources, therefore the Terraform configuration varies according to the preferred cloud provider – which will be Azure for this workshop.
* Introduction to Terraform
* What is Terraform?
* Concepts of Terraform: Resource Blocks, Terraform Block, Provider Block, State File, HCL Notation
* Commands: Init, Validate, Format, Plan, Apply, Destroy
* Terraform usage across multiple cloud platforms – examples
* Terraform automation for CI/CD platforms
* Set up the stage
* Setting up the development environment using a dev container with GitHub Codespaces (prepared for you)
* Login to the subscription using the Azure CLI
* Create the Terraform configuration using the official HashiCorp Style Guide
* Conducting the Terraform commands to deploy the resources on Azure
* Changing the resources with adapting the Terraform configuration
* Destroying the resources on Azure
* Deploy and destroy resources on Azure using Terraform
* Conclusion and derived Best Practice