From d4097c966b30ab4ac9d1ea16d5356cbc05a780e9 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Fri, 27 Oct 2017 16:00:14 +0100 Subject: [PATCH] r/emr_cluster: Expose error on TERMINATED_WITH_ERRORS --- aws/resource_aws_emr_cluster.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_emr_cluster.go b/aws/resource_aws_emr_cluster.go index aa9b7946f5e..bc8c9108f92 100644 --- a/aws/resource_aws_emr_cluster.go +++ b/aws/resource_aws_emr_cluster.go @@ -1006,9 +1006,9 @@ func resourceAwsEMRClusterStateRefreshFunc(d *schema.ResourceData, meta interfac } status := emrc.Status - if *status.State == "TERMINATING" { + if *status.State == "TERMINATING" || *status.State == "TERMINATED_WITH_ERRORS" { reason := *status.StateChangeReason - return emrc, *status.State, fmt.Errorf("EMR Cluster is terminating. %s: %s", + return emrc, *status.State, fmt.Errorf("%s: %s", *reason.Code, *reason.Message) }