Short script for creating and attaching an EBS Volume to an EC2 instance. This is useful in cases where you want to dynamically create your EBS volumes outside of the cloud formation auto provisioning process.

volume_name="Name of your volume" volume_id=`aws ec2 describe-volumes --filters Name=tag-key,Values=diskuse,Name=tag-value,Values=${volume_name} |jq -r --arg zone "$zone" ' | select( (.State=="available") and (.AvailabilityZone==$zone))] | .VolumeId'`