/terraform-provider-activedirectory

Terraform Active Directory provider

Primary LanguageGoApache License 2.0Apache-2.0

Terraform Provider - Active Directory

Go Report Card CircleCI Codecov GitHub license GitHub release

HashiCorp TerraformMicrosoft Active Directory

This is a Terraform Provider to work with Active Directory.

This provider currently supports only computer objects, but more active directory resources are planned. Please feel free to contribute.

For general information about Terraform, visit the official website and the GitHub project page.

More information can be found on the Active Directory Provider GitHub pages.

Simple Usage Example

# Configure the AD Provider
provider "activedirectory" {
  host     = "ad.example.org"
  domain   = "example.org"
  use_tls  = false
  user     = "admin"
  password = "password"
}

# Add computer to Active Directory
resource "activedirectory_computer" "test_computer" {
  name           = "TerraformComputer"                      # update will force destroy and new
  ou             = "CN=Computers,DC=example,DC=org"         # can be updated
  description    = "terraform sample server"                # can be updated
}

# Add ou to Active Directory
resource "activedirectory_ou" "test_ou" {
  name           = "TerraformOU"                            # can be updated
  base_ou        = "OU=Test,CN=Computers,DC=example,DC=org" # can be updated
  description    = "terraform sample ou"                    # can be updated
}

# Add group to Active Directory
resource "activedirectory_group" "test_group" {
  name = "TerraformGroup"
  base_ou = "OU=Test,CN=Computers,DC=example,DC=org"
  description = "terraform sample group"
  scope = "domainlocal"
  category = "security"
  member = ["jdoe", "ckent"]
  ignore_members_unknown_by_terraform = false
}