Create Azure AD Group With Terraform

In this blog post about Terraform, we will learn how to create an Azure Active Directory group using a Terraform configuration code.

In the previous post, we learned how to create an Active Directory user with Terraform and now we will get into groups.

If you need to set up Terraform on your Windows or macOS machine please visit the following post.

Terraform Configuration

In the following Terraform configuration I am creating a single Azure Active Directory group called Terraform admins.

terraform {
required_providers {
azuread = {
source = "hashicorp/azuread"
version = "1.0.0"
}
}
}

provider "azuread" {
# Configuration options
}
resource "azuread_group" "terraformadmins"{
name = "Terrafrom Admins"
description = "An Azure AD Group for Terraform administrators"
prevent_duplicate_names = true
}

This blog post was first published on our sister site https://www.ntweekly.com

Leave a comment

Your email address will not be published. Required fields are marked *