Welcome! This code is meant to accompany the Terraform Tutorial on env0's blog. The code included will deploy a resource group and container instance on Microsoft Azure.
- An Azure subscription
- Azure CLI installed
- Terraform installed
You can alternatively use the Azure Cloud Shell that has the Azure CLI and Terraform preinstalled.
Start by logging in to your Azure account using the Azure CLI:
# Login into Azure in a browser
az login
# Select the Azure subscription to use
az account set -s SUB_NAME
Now you can initialize Terraform:
terraform init
To deploy the infrastructure, run the following command:
terraform plan -out plan.out
terraform apply plan.out
Once you deployed it successfully, remove the commented out tags argument in the azurerm_resource_group
resource and deploy again.
terraform apply -auto-approve
When you're done, you can destroy the infrastructure by running:
terraform destroy
I hope you enjoyed this tutorial! If you have any questions, feel free to reach out to me on Twitter or LinkedIn.