How to list security groups for the specific instance via CLI?
You can use aws ec2 describe-instances instead, you can specify the id --instance-ids &lt;value&gt; and it will output the security group.