Getting started
Prequisites
Install Azure cli on your machine using the official instructions: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
Install Terraform using the official instructions: https://developer.hashicorp.com/terraform/downloads?product_intent=terraform
Sign in to azure cli using
az login
and follow the on screen instructions to sign inCreate a local folder
Create a main.tf file and add the content
# Define providers for this terraform project
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.0.0"
}
}
}
# Configure the Microsoft Azure Provider
# Required to even work, but not neccesary to configure anything more than this
provider "azurerm" {
features {}
}
# Create a resource group
# Terraform location mapping list: https://github.com/claranet/terraform-azurerm-regions/blob/master/REGIONS.md
resource "azurerm_resource_group" "rg-sentinel-dev-westeurope-01" {
name = "rg-sentinel-dev-westeurope-01"
location = "West Europe"
}
Intialize the project with
terraform init
with should complete successfully

Validate the project with
terraform validate
Run
terraform plan

If everything looks good, run
terraform apply
Accepts the changes


Verify in Azure that the resource group has been created.
To remove the resources run
terraform destroy
and verify that the resource group is gone

Last updated
Was this helpful?