Skip to content

Instantly share code, notes, and snippets.

@migueltg
Created November 10, 2020 07:57
Show Gist options
  • Save migueltg/3edbd63cf3127326f0a545f6a8b63965 to your computer and use it in GitHub Desktop.
Save migueltg/3edbd63cf3127326f0a545f6a8b63965 to your computer and use it in GitHub Desktop.
#!/bin/sh
export AWS_DEFAULT_REGION=us-east-1
eipid=eipalloc-id
instanceid=$(wget -q -O - http://instance-data/latest/meta-data/instance-id)
aws ec2 associate-address --instance-id $instanceid --allocation-id $eipid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment