Skip to content

Commit

Permalink
Merge pull request #33800 from hashicorp/b-d/aws_fsx_ontap_storage_vi…
Browse files Browse the repository at this point in the history
…rtual_machine-crash

aws_fsx_ontap_storage_virtual_machine: Fix crash when `active_directory_configuration.self_managed_active_directory_configuration.file_system_administrators_group` is not configured
  • Loading branch information
ewbankkit authored Oct 6, 2023
2 parents 41e740e + cbe94a4 commit e7eb11d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changelog/33800.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:bug
resource/aws_fsx_ontap_storage_virtual_machine: Fix crash when `active_directory_configuration.self_managed_active_directory_configuration.file_system_administrators_group` is not configured
```

```release-note:bug
data-source/aws_fsx_ontap_storage_virtual_machine: Fix crash when `active_directory_configuration.self_managed_active_directory_configuration.file_system_administrators_group` is not configured
```
8 changes: 6 additions & 2 deletions internal/service/fsx/ontap_storage_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,12 @@ func flattenSelfManagedActiveDirectoryAttributes(d *schema.ResourceData, rs *fsx
// if we can or Terraform will show a difference for the argument from empty string to the value.
// This is not a pattern that should be used normally.
// See also: flattenEmrKerberosAttributes
m["file_system_administrators_group"] = d.Get("active_directory_configuration.0.self_managed_active_directory_configuration.0.file_system_administrators_group").(string)
m["password"] = d.Get("active_directory_configuration.0.self_managed_active_directory_configuration.0.password").(string)
if v, ok := d.GetOk("active_directory_configuration.0.self_managed_active_directory_configuration.0.file_system_administrators_group"); ok {
m["file_system_administrators_group"] = v.(string)
}
if v, ok := d.GetOk("active_directory_configuration.0.self_managed_active_directory_configuration.0.password"); ok {
m["password"] = v.(string)
}

return []interface{}{m}
}
Expand Down

0 comments on commit e7eb11d

Please sign in to comment.