This example command will get list of managed instances.
aws ssm describe-instance-information --filters Key=ResourceType,Values=ManagedInstance --query "InstanceInformationList.InstanceId" --output text
In addition, you can also filter by IAM role like this:
aws ssm describe-instance-information --filters Key=ResourceType,Values=ManagedInstance Key=IamRole,Values=MyExampleRole --query "InstanceInformationList.InstanceId" --output text
Hope this helps.
Get all A Records from route 53 using CLI and export to CSVasked 3 months ago
How to get a list of ALL SQS queues?Accepted Answerasked 3 months ago
Get a list of all managed instance IdsAccepted Answerasked 4 years ago
How to pull a list of all folders in a Workdocs instance?asked 5 months ago
How to list buckets only from a certain region using the CLI?asked 10 months ago
How do we select the entire contents of a bucket (all images), and bulk copy URL list for all the objects?asked 7 months ago
AWS CLI & Cognito : Able to list user details but unable to list all usersasked 2 years ago
IAM: CLI: How to get contents of a policy?Accepted Answerasked 3 years ago
AWS cli - List all the deprecated lambda runtimeasked 9 months ago
Is there a way to set the ip conditions of AWS WAF all that once by uploading a list?asked a month ago