session = boto3.Session()
client = session.client('ecs')
cluster = client.list_clusters()
clusterArns = cluster["clusterArns"]
print(clusterArns)
for i in clusterArns:
print(i.split('/')[1])
session = boto3.Session()
client = session.client('ecs')
cluster = client.list_clusters()
clusterArns = cluster["clusterArns"]
print(clusterArns)
for i in clusterArns:
print(i.split('/')[1])
The response will contain a nextToken if there are any additional pages of results.
If this is returned in a response you will need to run the client.list_clusters() passing in this parameter again to get the next page.
The MaxResults of a single page can only be between 1 and 100 so there is no way to increase the maximum items returned.
You can find out more about the list_clusters function from the documentation.