📜  aws cli ec2 列出安全组 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:07.905000             🧑  作者: Mango

代码示例1
# 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"