1

I have a application A in AWS which is dependent to another application B which is also in AWS ,but host B has many instances so it has many dynamic IPs how to add this IP in AWS inbound of Host A load balancer security group.Now for Example if i have 20 B host i should mention 20 ip in the host A load balancer security group is there any other ways?

  • I agree with @Tom! You will need to expose ELB as single point of access for your service B and point all requests from A to ELB instance which in turn can load balance your requests to different B service instances. And this way you can just add only 1 IP to your inbound restriction! – Avik Aggarwal Oct 18 '18 at 05:18
  • Could you please clarify your architecture? It appears that you have a Load Balancer in front of a single Amazon EC2 instance running Application A. You also seem to have multiple Amazon EC2 instances running Application B. Is there also a Load Balancer for Application B? Do you wish to grant access from all instances running Application B to access Application A? And would they access Application A directly, or would it be via the Application A Load Balancer? Feel free to edit your question to clarify your architecture. – John Rotenstein Oct 18 '18 at 06:47

2 Answers2

0

You'll probably want to put an Elastic Load Balancer in front of the B hosts, and have A make requests to the ELB. This allows A to not care about the IPs of the B hosts, and also helps spread load evenly across all the B hosts.

Tom
  • 1,660
  • 8
  • 16
0

Just put all of your application B instances in one security group, and add that security group to application A security group as the custom source.

enter image description here

So, it's mean all of application B instances with the same SG, can access your application A.

For more information about security groups, read the following documents on the AWS website:

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html#security-group-rules

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html

Reza Mousavi
  • 4,420
  • 5
  • 31
  • 48