Last active
June 9, 2020 04:22
-
-
Save bashtoni/111288116ab3ff2159fdf59fb1760017 to your computer and use it in GitHub Desktop.
Attach multiple volumes to an EC2 Instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count=0 | |
for vol in vol-0123abcd vol-1023abcd vol-2013abcd ; do | |
device="/dev/xvd$(echo $count | tr '[0-9]' '[j-z]')" | |
aws ec2 attach-volume --volume-id $vol --instance-id i-123456789abc --device $device | |
count=$(expr $count + 1) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment