You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List the all the Instances With all the Instances Details along with attached Volume Details it must include Volume Name, Volume ID and Size.
Using this command I can be able to list the volume details with instance id and volume size.
aws ec2 describe-volumes –-query "Volumes[*].[Attachments[0].VolumeId,AvailabilityZone,Attachments[0].InstanceId,Attachments[0].State,Size]" --output text > test.txt
But my query I have to consolidate the whole instance list its includes instance id, instance state, region, platform, key pair name along with attached volumes name, volume id, volume size and mount path name like /dev/sda1,
Please help me with this.
Using this command can be able to get the instance details but I need to single query to get all the details.
@Selvaslm4 you cannot do it in one query, what I may suggest is to use for-loops in bash, something like
for i in $(aws ec2 describe-instances --query ... --output text) ; do
for v in $(aws ec2 describe-volumes --query ... --output text) ; do
echo "${i} ${v}"
done
done
List the all the Instances With all the Instances Details along with attached Volume Details it must include Volume Name, Volume ID and Size.
Using this command I can be able to list the volume details with instance id and volume size.
aws ec2 describe-volumes –-query "Volumes[*].[Attachments[0].VolumeId,AvailabilityZone,Attachments[0].InstanceId,Attachments[0].State,Size]" --output text > test.txt
But my query I have to consolidate the whole instance list its includes instance id, instance state, region, platform, key pair name along with attached volumes name, volume id, volume size and mount path name like /dev/sda1,
Please help me with this.
Using this command can be able to get the instance details but I need to single query to get all the details.
aws ec2 describe-instances --filters "Name=instance-state-name,Values=*" --query "Reservations[].Instances[].[Tags[?Key==Name]| [0].Value,InstanceId,State.Name,InstanceType,Placement.AvailabilityZone,PrivateIpAddress,VolumeInfo:BlockDeviceMappings" --output text > instances.txt