How to get a filtered list of AWS EMR clusters?

1k Views Asked by At

I want to get list of EMR clusters that have a specific tag value. I looked up the ListClusters API but that does not allow to add custom filters. How can I apply filter in the API call or implement a two step solution (first get all clusters and then filter them)?

1

There are 1 best solutions below

0
Michael C On

The service API doesn't expose a tags parameter in the request or response so you would need to first call ListClusters and then follow with DescribeCluster for every cluster id to expose the tags. An alternative approach would be to embed any tags or data in the cluster name for the list of clusters to be filterable by name after the first step but this is probably not a suitable approach as tags may change.