| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Managed Microsoft Active Directory" |
| description: |- |
| Creates a Microsoft AD domain |
| --- |
| |
| # google\_active\_directory\_domain |
| |
| Creates a Microsoft AD domain |
| |
| |
| To get more information about Domain, see: |
| |
| * [API documentation](https://cloud.google.com/managed-microsoft-ad/reference/rest/v1/projects.locations.global.domains) |
| * How-to Guides |
| * [Managed Microsoft Active Directory Quickstart](https://cloud.google.com/managed-microsoft-ad/docs/quickstarts) |
| |
| ## Example Usage - Active Directory Domain Basic |
| |
| |
| ```hcl |
| resource "google_active_directory_domain" "ad-domain" { |
| domain_name = "tfgen.org.com" |
| locations = ["us-central1"] |
| reserved_ip_range = "192.168.255.0/24" |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `reserved_ip_range` - |
| (Required) |
| 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 |
| |
| * `locations` - |
| (Required) |
| 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. |
| |
| * `domain_name` - |
| (Required) |
| The fully qualified domain name. e.g. mydomain.myorganization.com, with the restrictions, |
| https://cloud.google.com/managed-microsoft-ad/reference/rest/v1/projects.locations.global.domains. |
| |
| |
| - - - |
| |
| |
| * `labels` - |
| (Optional) |
| Resource labels that can contain user-provided metadata |
| **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. |
| Please refer to the field `effective_labels` for all of the labels present on the resource. |
| |
| * `authorized_networks` - |
| (Optional) |
| 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. |
| |
| * `admin` - |
| (Optional) |
| The name of delegated administrator account used to perform Active Directory operations. |
| If not specified, setupadmin will be used. |
| |
| * `project` - (Optional) The ID of the project in which the resource belongs. |
| If it is not provided, the provider project is used. |
| |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `{{name}}` |
| |
| * `name` - |
| The unique name of the domain using the format: `projects/{project}/locations/global/domains/{domainName}`. |
| |
| * `fqdn` - |
| 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. |
| |
| * `terraform_labels` - |
| The combination of labels configured directly on the resource |
| and default labels configured on the provider. |
| |
| * `effective_labels` - |
| All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 60 minutes. |
| - `update` - Default is 60 minutes. |
| - `delete` - Default is 60 minutes. |
| |
| ## Import |
| |
| |
| Domain can be imported using any of these accepted formats: |
| |
| * `{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Domain using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "{{name}}" |
| to = google_active_directory_domain.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Domain can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_active_directory_domain.default {{name}} |
| ``` |
| |
| ## User Project Overrides |
| |
| This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |