Skip to content

Instantly share code, notes, and snippets.

@lantrix
Created September 16, 2014 01:49
Show Gist options
  • Select an option

  • Save lantrix/c8db38a6226518a2b205 to your computer and use it in GitHub Desktop.

Select an option

Save lantrix/c8db38a6226518a2b205 to your computer and use it in GitHub Desktop.
Find and attach volumes in AWS
$filter = New-Object Amazon.EC2.Model.Filter
$filter.Name = "tag:Version"
$filter.Value = "31"
$volumes = Get-EC2Volume -Filters $filter
$volumes | % {$_.VolumeId + " " + $_.State}
Add-EC2Volume -VolumeId vol-ec9398e8 -InstanceId i-5256f66e -Device 'xvdg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment