Answers for "aws cli ec2 list security groups"

1

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"
Posted by: Guest on June-11-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language