Apologies if this has been answered before; my google skills failed me.

Even larger apologies if this is a n00b's question.

We are planning on using AWS cloud formations to drive some load testing through our public apis.

Our apis sit behind load balancers which base their decisions on among other things; the source ip of the requestor.

Let's say we have a cloud formation of a thousand EC2 VMs; each making requests to our public apis; do these requestors appear as if coming from the one location or will they all have different source ip addresses? We are concerned that our load balancers may not behave in a real world manner.


Requests from the instances will show up with that particular instance's public IP.

The one exception is for instances in a private VPC subnet, which will show up with the IP of their NAT instance, as private VPC instances have no external facing IP.

  • So in effect; each instance will present to our load balancer with a different ip address? – Dave Lawrence Jun 14 '13 at 8:10
  • Yes, that's correct. – ceejayoz Jun 14 '13 at 11:42

AWS EC2 instances are assigned a static IP address at boot. This address will change each time you reboot the instance.

If you want a persistent IP address for a specific instance, you then need to get a Elastic IP address. This can be mapped to a specific instance. These IPs are 1:1 NAT on the public side. You assign the IP to the instance in the AWS console.





I think ceejayoz nailed the answer, however I just want to clarify that the fact that your API servers are behind a load balancer is irrelevant. The API servers see the client's IP regardless of the existence of the load balancers. All the load balancers do is provide a single entry point for the API to the clients, and of course balance the requests across the multiple API servers.

If the clients are on a private network behind a shared public IP (like ceejayoz's example with the VPC), then the API servers will only be able to see the shared public IP, unless the API Load Balancer is also on that same private network, which is highly unlikely unless you own the clients too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.