Answers for "aws cli ec2 list instances"

1

aws cli ec2 list instances

# Get list of all EC2 (all info)
awsProfile="awsProfileName" # Use your aws profile name
aws --profile "$awsProfile" ec2 describe-instances

# Get list of all EC2 (custom filter)
awsProfile="awsProfileName" # Use your aws profile name
awsQuery="Reservations[].Instances[].{InstanceId:InstanceId,Placement:Placement,PrivateIpAddress:PrivateIpAddress,PublicIpAddress:PublicIpAddress,Tags:Tags}"
aws --profile "$awsProfile" ec2 describe-instances --query "$awsQuery"
Posted by: Guest on June-11-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language