SecurityGroupDetails.sh 395 B

123456789101112131415161718
  1. #! /bin/bash
  2. #
  3. # Prints security group details given a profile and an ID
  4. # You can decide for yourself which is easiest to read. Options are
  5. # 'json', 'text', or 'table'
  6. OUTPUT=json
  7. if [ $# -ne 3 ]; then
  8. echo Usage: $0 "<profile> <region> <groupid>"
  9. exit 1
  10. fi
  11. PROFILE=$1
  12. REGION=$2
  13. SG=$3
  14. aws ec2 describe-security-groups --profile $PROFILE --region $REGION --output $OUTPUT --group-ids $SG