Reputation: 11
I am trying to understand why AWS allows to associate EIP for an instance in private subnet. How to make use of this EIP? Is there any possibility to access the instance using this EIP without an igw in the private subnet?
Upvotes: 1
Views: 919
Reputation: 35188
Remember that the concept of a public vs private subnet is simply down to the routing configuration within the route table and then applied any subnets that are bound via a subnet association.
The EC2 service only cares that the instance itself is located in a particular subnet, not what the routing configuration is. This is by design, of course it could be designed to perform lookups but from the AWS service perspective these additional lookups would be required during the validation.
No one can no for certain why the decision was made to omit this validation but it will likely be due to performance of that lookup for any new ENI resources being created which I imagine would generate a large overhead.
For your second question, it cannot use the EIP without an internet gateway. A NAT will perform only one way address translation and the egress only gateway operates over IPv6.
Upvotes: 2