Skip to content

Instantly share code, notes, and snippets.

@reisjr
Created June 1, 2018 22:01
Show Gist options
  • Select an option

  • Save reisjr/79f98a29d61c2fc382f67009e1164591 to your computer and use it in GitHub Desktop.

Select an option

Save reisjr/79f98a29d61c2fc382f67009e1164591 to your computer and use it in GitHub Desktop.
Collection of EC2 snippets
#!/bin/bash
INSTANCE_ID=`curl http://169.254.169.254/latest/meta-data/instance-id` #para pegar o id da instância
VOL_ID=`aws ec2 create-volume --availability-zone us-east-1a --output text --query "VolumeId" --snapshot-id xxxxxxx --region us-east-1`
aws ec2 attach-volume --volume-id $VOL_ID --instance-id $INSTANCE_ID --device /dev/sdf --region us-east-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment