Why Can’t I Associate Elastic IP with EC2 Instance

amazon-elastic-ip

I have a running EC2-classic instance, at t2-micro. It has the public IP that was associated with it when it started. Despite having RTFM three times[1] I can't figure out how to associate an allocated elastic IP with the running instance.

I allocated a new address under "Elastic IPs". I right click and do "Associate Address". It gives me a "search instance id or tag" field, but it doesn't seem to be able to find the (running) instance by either one, whether I start typing the first few characters or if paste the whole thing in. If I do paste the whole id or name in and hit enter I get an error "An error occurred while attempting to associate the address / The request must contain the parameter instance id". Instance and Elastic IP are both in us-west1.

[1] http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html

Best Answer

You can't allocated a VPC EIP with an EC2-classic instance. I suspect Elastic IPs are allocated in VPC by default.

I suggest you allocate a new EIP you look for options about where it's created and make sure it says "EC2 Classic". I don't have access to EC2-classic as my account is too new. Amazon has documentation on this topic here.

This page has some useful information:

After some playing around – for way longer than I wanted to spend – I deleted the elastic IP and recreated it. When first creating (“allocating”) an elastic IP it gives you two choices – EC2 or VPC. The default selected in the list is EC2 and that’s what I originally left as my selected choice. I changed this to VPC and voila! – now I could associate the IP to my running VM nice and easily.