How to add AWS inbound restriction for AWS instances

48 Views Asked by At

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?

2

There are 2 best solutions below

0
Tom On

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.

0
Reza Mousavi On

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