5

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

joseph_morris
  • 245
  • 3
  • 9
  • 2
    *"I have a running EC2-classic instance, at t2-micro."* **This assertion seems very unlikely.** [*"You must launch your T2 instances into a virtual private cloud (VPC); they are not supported on the EC2-Classic platform."*](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html) If you have a t2.micro, you should find that it is in a VPC. – Michael - sqlbot Sep 28 '16 at 23:43
  • Well that was confusing, but @Michael-sqlbot is right. I had assumed it was EC2-classic because I was in the "EC2 Dashboard" and "VPC" is an entirely different thing on the AWS dashboard subtitled "Isolated Cloud Resources" and from a common-sense perspective it's not exactly isolated when it comes with a public IP by default. But, my EC2 instance is VPC. I call UX foul on AWS, but now I can associate the EIP. – joseph_morris Sep 29 '16 at 16:05
  • In the console, the "VPC" section is for administering your virtual private cloud network environments ("VPCs") -- these are isolated regional networks into which you can deploy instances of EC2, RDS, Lambda, and other services. For accounts established after 2013-12-04, one VPC is created automatically for you -- [the default VPC, which *"combines the benefits of the advanced networking features provided by the EC2-VPC platform with the ease of use of the EC2-Classic platform"*](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html) -- hence that automatic public IP feature. – Michael - sqlbot Sep 29 '16 at 19:04

3 Answers3

5

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.

Tim
  • 31,888
  • 7
  • 52
  • 78
  • EC2 is the default, and what I chose. Just deleted the EIP and allocated another to confirm. No dice, still can't find server to associate. – joseph_morris Sep 28 '16 at 23:12
  • Please post screen shots of the EC2 instance details and the EIP details. Blank out anything you consider sensitive. – Tim Sep 28 '16 at 23:21
1

It is now possible to migrate an EIP between standard scope and VPC scope but you first need to disassociate your Elastic IP from your instance (so you will see a short amount of downtime). NOTE: if the EIP was created in the VPC scope, you can't migrate to standard scope.

You can then move the Elastic IP between the scopes:

allocate classic elastic IP address to instance in VPC

It can take a few minutes to transition over unfortunately and it may look like it has disappeared for a moment (details here). Once it has moved over, you can then allocate it to your instance in VPC.

Willster
  • 131
  • 3
1

I had the same problem. It turned out that the regions didn't match.

Solution:

From the same browser tab, same console where you can see your instance running, go to EIP, Allocate New Address. Click on AWS Command Line Interface command link to view what region is being used for the new address. It must match the region that's listed as Availability Zone for your instance. Allocate. Then, Associate the address. The instance you need will be on the list.


Where the wrong region came from:

FROM THEIR TUTORIAL. The link to all AWS services from the AWS tutorial point to a different region. Confirm it by looking at the url. Fix the issue by changing the region to the correct one directly in your address bar before logging in to the service.

Kamiccola
  • 11
  • 2