Skip to content

Azure AD Data Module

Note No Terraform-Managed Resources are created

This is a data-only module that will perform a lookup in AD, given a list group/user ids/names/aliases.

A map of objects will be returned with the keys being each of the provided identifiers in the input variable, var.azuread_identifiers. The values will have basic information about the object, such as object_id, display_name, etc. This can then be used as input for other resources, especially for assigning RBAC access or using as the member list for new AzureAd-Groups.

Input

  azuread_identifiers = set(string)

Variables

objects

This is an identifier of the AzureAd object to lookup. It can be of a Group or User, and the identifier can be a mix of objectIds, group displayNames, user email addresses (UPNs), and user aliases (usernames).

Output

##Example for User
  string(var.azuread_identifiers[*]) => object({
      object_id           = user.object_id
      display_name        = user.display_name
      mail_nickname       = user.mail_nickname
      user_principal_name = user.user_principal_name
      type                = "User"
  })

##Example for Group
  string(var.azuread_identifiers[*]) => object({
      object_id        = group.object_id
      display_name     = group.display_name
      type             = "Group"
  })

Requirements

Name Version
terraform >= 1.0
azuread >= 2.47.0
azurerm >= 3.114.0

Providers

Name Version
azuread >= 2.47.0

Resources

Name Type
azuread_groups.by_id data source
azuread_groups.by_name data source
azuread_users.by_id data source
azuread_users.by_name data source
azuread_users.by_upn data source

Inputs

Name Description Type Default Required
azuread_identifiers List of AzureAD_Identifiers. Identifier may be one of Group display_name, User mail_nickname, User upn, or object_id for either. set(string) [] no

Outputs

Name Description
values n/a