Created
June 11, 2020 07:43
-
-
Save imnnquy/affd62e7e134ace334a0f43e8cd1772e to your computer and use it in GitHub Desktop.
Auto attach eip to instance
This file contains 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
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