diff --git a/.changelog/38773.txt b/.changelog/38773.txt new file mode 100644 index 00000000000..83c26a72f73 --- /dev/null +++ b/.changelog/38773.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_emr_cluster: Fix panic when reading an instance fleet with an empty `launch_specifications` argument +``` diff --git a/internal/service/emr/cluster.go b/internal/service/emr/cluster.go index 56894efac3f..16ce540fa03 100644 --- a/internal/service/emr/cluster.go +++ b/internal/service/emr/cluster.go @@ -2132,7 +2132,7 @@ func readInstanceFleetConfig(data map[string]interface{}, InstanceFleetType stri config.InstanceTypeConfigs = expandInstanceTypeConfigs(v.List()) } - if v, ok := data["launch_specifications"].([]interface{}); ok && len(v) == 1 { + if v, ok := data["launch_specifications"].([]interface{}); ok && len(v) == 1 && v[0] != nil { config.LaunchSpecifications = expandLaunchSpecification(v[0].(map[string]interface{})) }