📅  最后修改于: 2022-03-11 14:50:07.905000             🧑  作者: Mango
# 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"