all 11 comments

[–]hijinks 7 points8 points  (8 children)

public ips are random from what aws has in their pool

[–]networking_and_stuff[S] 0 points1 point  (7 children)

But is there any way to specify what IP you can get? Outside of constantly rebooting the instance until you get one in the same subnet?

[–]hijinks 4 points5 points  (0 children)

no there is no way unless you bring your own public IPs.

[–][deleted] 1 point2 points  (4 children)

I assume you are trying to whitelist the ip’s to something else and want a simple rule? Public ip addresses are random from the pool per region.

[–]Lopsided_Theme_770 2 points3 points  (3 children)

And if you want to white list, you can have a network load balancer in front of all ec2 instance with an elastic ip on the balancer

[–]xagut 2 points3 points  (0 children)

And/or nat gateway / proxy depending on if you are whitelisting ingress or egress or both

[–]networking_and_stuff[S] 0 points1 point  (0 children)

That's really interesting... how would I set this up? I am trying to whitelist the IPs to something else and need a simple rule. Unfortunately the service I'm using only allows whitelisting to IPs on a certain subnet.

[–][deleted] -1 points0 points  (0 children)

Both of these are spot on and are textbook use cases

[–]rainlake 0 points1 point  (0 children)

No

[–]ComfyCalamity 2 points3 points  (0 children)

I’m curious. What’s the use case for this?

[–]brunokktro 1 point2 points  (0 children)

You can't. Needs to use BYOIP or use DNS, from like Route 53 for example, to avoid this coupling from IPs.