Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

aws cli ec2 list security groups

# Get EC2 Security Group
awsProfile="awsProfileName" # Use your aws profile name
instanceId="i-00000000000000000" # Enter instance ID
awsQuery="Reservations[].Instances[].{SecurityGroups:SecurityGroups}[0]"
aws --profile "$awsProfile" ec2 describeInstance --instance-ids "$instanceId" --query "$awsQuery"
 
PREVIOUS NEXT
Tagged: #aws #cli #list #security #groups
ADD COMMENT
Topic
Name
3+3 =