security - aws ec2 instances in different vpc subnets access each other -


i have 2 aws ec2 instances living inside 2 different subnets of vpc.

i allow ruby app running on first instance (say app#1) call endpoints of app (say app#2) running on 2nd instance.

i users directly call endpoints of app#2 browser.


here have tried (and failed):

  1. [sucess!] added known ip addresses of users inbound rules of load balancer security group of app#2 , have confirmed can access app#2 endpoints browsers.

  2. [fail!] added load balancer security group id of app#1 inbound rules load balancer security group of app#2. logs tell me app#1 cannot access endpoints of app#2.

  3. [fail!] added vpc security group id of app#1 inbound rules of load balancer security group of app#2 - nope, still doesn't work. (somehow, when launched instance app#1, aws automatically created 2 security groups instance - 1 vpc , 1 load balancer... have no idea why/how happened...)

  4. [fail!] added cidr subnet app#1 in inbound rules of load balancer security group of app#2. still no joy.

  5. [success...sort of] assigned elastic ip instance running app#1 , added inbound rules of load balancer security group of app#2. works rather not use method since elastically scale app#1 in future , not know how automatically assign more elastic ips new instances when spin up, add them inbound rules, , somehow remove them when shut down.

i feel there has got clean solution problem , missing painfully obvious. can please give me hint?

any appreciated!

it sounds might using public ip address of load balancer, looks traffic coming outside. try using private ip/dns if there one, or setting second, internally-facing load balancer.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -