Created
June 4, 2020 08:26
-
-
Save bashtoni/a83e0ea00d3b3c23efb6bd1d02e83cec to your computer and use it in GitHub Desktop.
Create volume with name matching snapshot name
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
snap=snap-123456789 | |
desc=$(aws ec2 describe-snapshots --snapshot-ids $snap --query Snapshots[].Description --output text) | |
aws ec2 create-volume --snapshot-id $snap --availability-zone ap-southeast-2c --tag-specifications "[{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"Name\",\"Value\":\"$desc\"}]}]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment