Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws/resource_aws_emr_cluster.go: Filter completed EMR steps from ListSteps API #20871

Merged
3 changes: 3 additions & 0 deletions .changelog/20871.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release=note:bug
resource/aws_emr_cluster: EMR steps with status 'Completed' are now filtered from ListSteps API
```
15 changes: 14 additions & 1 deletion aws/resource_aws_emr_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,21 @@ func resourceAwsEMRClusterRead(d *schema.ResourceData, meta interface{}) error {
}

var stepSummaries []*emr.StepSummary
states := []string{
"PENDING",
"CANCELLED",
"FAILED",
"CANCEL_PENDING",
"RUNNING",
"INTERRUPTED",
}
var stepStates []*string
for _, v := range states {
stepStates = append(stepStates, &v)
}
ewbankkit marked this conversation as resolved.
Show resolved Hide resolved
listStepsInput := &emr.ListStepsInput{
ClusterId: aws.String(d.Id()),
ClusterId: aws.String(d.Id()),
StepStates: stepStates,
}
err = emrconn.ListStepsPages(listStepsInput, func(page *emr.ListStepsOutput, lastPage bool) bool {
// ListSteps returns steps in reverse order (newest first)
Expand Down