Skip to content

Commit

Permalink
Add step filter to List-Steps API for long running EMR clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
dsc133 committed Sep 10, 2021
1 parent 50dba1a commit 30591fd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion aws/resource_aws_emr_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,19 @@ func resourceAwsEMRClusterRead(d *schema.ResourceData, meta interface{}) error {
}

var stepSummaries []*emr.StepSummary
states := []string{
"PENDING",
"FAILED",
"CANCEL_PENDING",
"RUNNING",
}
var stepStates []*string
for _, v := range states {
stepStates = append(stepStates, &v)
}
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

0 comments on commit 30591fd

Please sign in to comment.