Getting started

Prequisites

  1. Install Azure cli on your machine using the official instructions: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli

  2. Install Terraform using the official instructions: https://developer.hashicorp.com/terraform/downloads?product_intent=terraform

  3. Sign in to azure cli using az login and follow the on screen instructions to sign in

  4. Create a local folder

  5. 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"
}
  1. Intialize the project with terraform init with should complete successfully

  1. Validate the project with terraform validate

  1. Run terraform plan

  1. If everything looks good, run terraform apply

  2. Accepts the changes

  1. To remove the resources run terraform destroy and verify that the resource group is gone

Last updated