EC2 Instances will not keep elastic IP

后端 未结 3 1041
无人及你
无人及你 2020-12-21 01:09

So, I don\'t understand what is going on here... I have (3) Micro EC2 Instances which are launched (without elastic ip)

I then go to Network Security->Elast

3条回答
  •  庸人自扰
    2020-12-21 01:35

    Elastic IPs become disassociated with EC2 instances (in EC2-Classic) when you stop them. You will need to re-associate them again on startup, which can be done through the API (via AssociateAddress), CLI (via ec2-associate-address), or via the AWS Console.

    Here's what the Elastic IP documentation has to say on the matter:

    When you associate an EIP with an instance, the instance's current public IP address is released to the EC2-Classic public IP address pool. If you disassociate an EIP from the instance, the instance is automatically assigned a new public IP address within a few minutes. In addition, stopping the instance also disassociates the EIP from it.

    We solve this at work by tagging our dev instances (which are turned off overnight) with the desired elastic IP and run a script in the morning to first turn them on, and then re-associate the elastic IP.

提交回复
热议问题