Skip to content

Instantly share code, notes, and snippets.

@gcanales75
Created June 25, 2017 18:53
Show Gist options
  • Select an option

  • Save gcanales75/529029c20f1459260c8910d3364dc98c to your computer and use it in GitHub Desktop.

Select an option

Save gcanales75/529029c20f1459260c8910d3364dc98c to your computer and use it in GitHub Desktop.
Obtiene Información de volumenes EBS asociados a instancia
$instance = "mi_instanceId"
## Info general de la instancia
#(Get-EC2Instance -InstanceId $instance).instances | where {$_.InstanceId -eq $instance}
## Volumenes
$devices = ((Get-EC2Instance -InstanceId $instance).instances | where {$_.InstanceId -eq $instance}).BlockDeviceMappings
$volumes = $devices.Ebs.VolumeId
Foreach ($volume in $volumes) {
Get-EC2Volume -VolumeId $volume | select VolumeId,Size
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment