Security Group Inbound rules list using aws cli
for region in `aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text` do : if [ -z "$(aws ec2 describe-instances --region $region --filter "Name=instance-state-name,Values=running" --query "Reservations[*].Instances[*].[InstanceId, Tags[?Key=='Name'].Value|[0]]" --output text | awk '{print $1}')" ]; then echo "There are no EC2 Instances in the region :: "$region else echo "++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "Checking Amazon Instances on the region "$region echo "++++++++++++++++++++++++++++++++++++++++++++++++++++" fi for instance in `aws ec2 describe-instances --region $region --filter "Name=instance-state-name,Values=running" --query "Reservations[*].Instances[*].[Instanc...