amazon-web-servicesamazon-ec2elastic-ip

Auto assign of public IP to AWS EC2 instance after "Dissociate Elastic IP address" from EC2 instance


I used "Dissociate Elastic IP address" from an Amazon EC2 instance that was running and allocated that Elastic IP address to another instance. Since doing this, the EC2 instance does not have a public IP address.

In my subnets, auto-assign Public IP address is enabled, but the EC2 instance is still not getting a public IP address. I have restarted the EC2 instance and I have Stopped it and Started it again, but there is no public IP address.

Can anyone please share with me a solution for this?


Solution

  • It appears that your situation is:

    It sounds like the Amazon EC2 instance was launched with "Auto-Assign Public IP" turned OFF.

    From Amazon EC2 instance IP addressing - Amazon Elastic Compute Cloud:

    The public IP addressing feature is only available during launch. However, whether you assign a public IP address to your instance during launch or not, you can associate an Elastic IP address with your instance after it's launched.

    Since the instance was launched with this feature turned OFF, a Public IP address will not be assigned to the instance when the Elastic IP address is removed.

    To provide the instance with a Public IP address, you will need to create another Elastic IP address and assign it to the instance.