How to list all running EC2 spot instances

You can use one of the below commands to list all running spot instances.

aws ec2 describe-instances --filters "Name=instance-lifecycle,Values=spot"
aws ec2 describe-spot-instance-requests --query "SpotInstanceRequests[*].{ID:InstanceId}"

See also  How to resolve 'ALTER TABLE ALTER COLUMN cannot run inside a transaction block' in Redshift