From b13eb4e2538920106870ca1511b260051d763f79 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 6 Oct 2023 10:27:32 -0400 Subject: [PATCH 1/3] aws_fsx_ontap_storage_virtual_machine crash: Don't crash if 'active_directory_configuration.0.self_managed_active_directory_configuration.0.file_system_administrators_group' is nil. --- internal/service/fsx/ontap_storage_virtual_machine.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/service/fsx/ontap_storage_virtual_machine.go b/internal/service/fsx/ontap_storage_virtual_machine.go index 272d13c822a..26677d845a4 100644 --- a/internal/service/fsx/ontap_storage_virtual_machine.go +++ b/internal/service/fsx/ontap_storage_virtual_machine.go @@ -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} } From 21376f3b098f01e06c0e179869b1b2f73796124c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 6 Oct 2023 10:29:34 -0400 Subject: [PATCH 2/3] Add CHANGELOG entry. --- .changelog/#####.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 00000000000..0c7a9685ddd --- /dev/null +++ b/.changelog/#####.txt @@ -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 +``` \ No newline at end of file From cbe94a4cf115397fb9fa8f22ca34efc7988dc98d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 6 Oct 2023 10:31:17 -0400 Subject: [PATCH 3/3] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 33800.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 33800.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/33800.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/33800.txt