Skip to content

Commit

Permalink
azurerm_active_directory_domain_service - Add supports for `domain_…
Browse files Browse the repository at this point in the history
…configuration_type` (#16920)

* `azurerm_active_directory_domain_service" - Add supports for `domain_configuration_type`

* update test
  • Loading branch information
magodo authored May 26, 2022
1 parent b633567 commit dcfedca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ func resourceActiveDirectoryDomainService() *pluginsdk.Resource {
},
},

"domain_configuration_type": {
Type: pluginsdk.TypeString,
ForceNew: true,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
"FullySynced",
"ResourceTrusting",
}, false),
},

"tags": tags.Schema(),

"deployment_id": {
Expand Down Expand Up @@ -344,6 +354,10 @@ func resourceActiveDirectoryDomainServiceCreateUpdate(d *pluginsdk.ResourceData,
Tags: tags.Expand(d.Get("tags").(map[string]interface{})),
}

if v := d.Get("domain_configuration_type").(string); v != "" {
domainService.DomainServiceProperties.DomainConfigurationType = &v
}

if d.IsNewResource() {
// On resource creation, specify the initial replica set.
// No provision is made for changing the initial replica set, it should remain intact for the resource to function properly
Expand Down Expand Up @@ -448,6 +462,7 @@ func resourceActiveDirectoryDomainServiceRead(d *pluginsdk.ResourceData, meta in
d.Set("sync_owner", props.SyncOwner)
d.Set("tenant_id", props.TenantID)
d.Set("version", props.Version)
d.Set("domain_configuration_type", props.DomainConfigurationType)

d.Set("filtered_sync_enabled", false)
if props.FilteredSync == aad.FilteredSyncEnabled {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ resource "azurerm_active_directory_domain_service" "test" {
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
domain_name = "never.gonna.shut.you.down"
sku = "Enterprise"
filtered_sync_enabled = false
domain_name = "never.gonna.shut.you.down"
sku = "Enterprise"
domain_configuration_type = "FullySynced"
filtered_sync_enabled = false
initial_replica_set {
subnet_id = azurerm_subnet.aadds.id
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/active_directory_domain_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ The following arguments are supported:

* `domain_name` - (Required) The Active Directory domain to use. See [official documentation](https://docs.microsoft.com/azure/active-directory-domain-services/tutorial-create-instance#create-a-managed-domain) for constraints and recommendations.

* `domain_configuration_type` - (Optional) The configuration type of this Active Directory Domain. Possible values are `FullySynced` and `ResourceTrusting`. Changing this forces a new resource to be created.

* `filtered_sync_enabled` - Whether to enable group-based filtered sync (also called scoped synchronisation). Defaults to `false`.

* `secure_ldap` - (Optional) A `secure_ldap` block as defined below.
Expand Down

0 comments on commit dcfedca

Please sign in to comment.