AWS Elastic IP Network vpc is not attached to any internet gateway

richersoon picture richersoon · Feb 28, 2015 · Viewed 11.8k times · Source

I have given a limited access to a AWS account.

I already created an EC2 instance but when I try to associate an elastic ip, I got the error below:

An error occurred while attempting to associate the address
Network vpc-(security id) is not attached to any internet gateway

Answer

Antti Haapala picture Antti Haapala · Feb 28, 2015

You are using the new Amazon Virtual Private Cloud instead of the EC2 Classic. The cloud you are using lacks the internet gateway virtual component that is necessary for the cloud to be reachable from the public internet.

You need to add an internet gateway to your private cloud for it to be able to connect to internet; with that in place, you can use Elastic IPs (after all, they are internet addressable; your VPC instances can have static instance IPs), and add a routing entry for internet addresses (0.0.0.0/0, or a narrower space).