Add the CIDR block of your VPC to your ingress rules of your security group.
You will also need to ensure that egress rules are configured for your other security groups to allow outbound traffic from your instances. Again, you can limit it to the same CIDR block.
For example, if your VPC CIDR block was 10.0.0.0/16
, then:
- On your target security group, add an ingress rule on the desired port for
10.0.0.0/16
.
- On all possible source security groups, add an egress rule on the desired port for
10.0.0.0/16
.
However, to be more secure, I would recommend permitting traffic based on security group rather than CIDR block. For example:
- On your target security group, add an ingress rule on the desired port for the source security group.
- On your source security group, add an egress rule on the desire port for the target security group.