I was trying to associate an elastic IP to a running EC2 VM today and kept hitting this error. There is surprisingly little available via Google when typing in the error message – nothing actually with an exact match. So I figured I’d drop a quick post to help out other people like myself who might run into this issue.
I added an elastic IP and saw it in the list. The next day I noticed I got billed ($.03) for having an elastic IP that wasn’t assigned to an instance. OK. Strange but whatever. I went into the management console to assign the elastic IP to my running instance. I right-clicked and chose “associate” but no matter what options I tried to link it to my VM, it kept giving me this error.
Well, 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.
So, what’s the deal? Well, I guess new EC2 instances are created as VPC instances now by default. I don’t remember being asked or prompted when I created my instance.
VPC at Amazon stands for “Virtual Private Cloud”. If you are curious, here is a post that lists the differences between a classic EC2 instance and a newer VPC instance.
Hopefully this little tip saves someone else some time. I sure wish I’d stumbled across it earlier and saved the hassle and headache of tinkering to figure it out on my own.