跳至内容

powershell get-ec2volume for instance

0

how do I use get-ec2volume for an instanceid?

已提问 3 年前1084 查看次数
3 回答
0

Have you tried using -Filter with attachment.instance-id - The ID of the instance the volume is attached to

Reference : https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Volume.html

AWS
专家
已回答 3 年前
0

i tried this but I coudnt get anything

get-ec2volume -filter @{name='attachment.instance-id';values='{instance_id}'}

已回答 3 年前
0

This seems to work

Get-EC2Volume -Filter @{
    Name = 'attachment.instance-id'
    Values = 'i-006741b1111111111'
    } | `
Format-Table -Property Attachments, AvailabilityZone, VolumeType, VolumeId
Attachments           AvailabilityZone VolumeType VolumeId
-----------           ---------------- ---------- --------
{i-006741b1111111111} us-east-1a       standard   vol-0109acf1111111111
{i-006741b1111111111} us-east-1a       gp3        vol-07f563d2111111111
AWS
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。