Skip to content

Instantly share code, notes, and snippets.

@imnnquy
Created June 11, 2020 07:43
Show Gist options
  • Save imnnquy/affd62e7e134ace334a0f43e8cd1772e to your computer and use it in GitHub Desktop.
Save imnnquy/affd62e7e134ace334a0f43e8cd1772e to your computer and use it in GitHub Desktop.
Auto attach eip to instance
instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
allocated_eip=<elastic ip address>
aws ec2 associate-address --instance-id $instance_id --public-ip $allocated_eip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment