Google Managed Microsoft Active Directory Domain

This page shows how to write Terraform for Managed Microsoft Active Directory Domain and write them securely.

google_active_directory_domain (Terraform)

The Domain in Managed Microsoft Active Directory can be configured in Terraform with the resource name google_active_directory_domain. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub
resource "google_active_directory_domain" "ads" {
  domain_name       = var.ad_domain
  locations         = [var.location]
  reserved_ip_range = var.cidr_rd_ad
  admin         = var.ad_username
  authorized_networks = []
resource "google_active_directory_domain" "ad-domain" {
  domain_name       = ""
  locations         = ["us-central1"]
  reserved_ip_range = ""
resource "google_active_directory_domain" "ad-domain" {
  project             = var.project
  domain_name         = var.domain_name
  locations           = var.locations
  reserved_ip_range   = var.reserved_ip_range
  authorized_networks = var.authorized_networks
resource "google_active_directory_domain" "this" {
  admin               = var.admin
  authorized_networks = var.authorized_networks
  domain_name         = var.domain_name
  labels              = var.labels
  locations           = var.locations

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).


The name of delegated administrator account used to perform Active Directory operations. If not specified, setupadmin will be used.

The full names of the Google Compute Engine networks the domain instance is connected to. The domain is only available on networks listed in authorizedNetworks. If CIDR subnets overlap between networks, domain creation will fail.

The fully qualified domain name. e.g., with the restrictions,

  • fqdn optional computed - string

The fully-qualified domain name of the exposed domain used by clients to connect to the service. Similar to what would be chosen for an Active Directory set up on an internal network.

  • id optional computed - string
  • labels optional - map from string to string

Resource labels that can contain user-provided metadata

Locations where domain needs to be provisioned. [regions][compute/docs/regions-zones/] e.g. us-west1 or us-east4 Service supports up to 4 locations at once. Each location will use a /26 block.

  • name optional computed - string

The unique name of the domain using the format: 'projects/[project]/locations/global/domains/[domainName]'.

The CIDR range of internal addresses that are reserved for this domain. Reserved networks must be /24 or larger. Ranges must be unique and non-overlapping with existing subnets in authorizedNetworks

Explanation in Terraform Registry

Creates a Microsoft AD domain To get more information about Domain, see:

Frequently asked questions

What is Google Managed Microsoft Active Directory Domain?

Google Managed Microsoft Active Directory Domain is a resource for Managed Microsoft Active Directory of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Managed Microsoft Active Directory Domain?

For Terraform, the DonMorrisRak/Azure, yaroslavopsguru/gcp-tf-resources and rajeevkghosh/Active-Directory-Terraform source code examples are useful. See the Terraform Example section for further details.


Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.