I do not think this is possible. You can try to use the security group identifier instead of the name, but I'm not sure if they work in different regions. I just tried this and couldn't make it work. The rule was created just fine, but there is no guarantee that the security group that I added is actually from my account, since you can actually add security groups through accounts. This is most likely possible using a VPN connection, if you have one, since a VPN gives you much more control over the firewall rules, however I never tried.
All this is said. I think you should review the requirements of your application. I donβt know why you need to connect between the two regions, I understand that your goal is to achieve geographical redundancy. However, requiring two environments to connect to each other, I chose the red flag for me when considering failover. If you are surrounded by an environment, you run the risk of getting a complete failure, even if one environment does not work. What purpose, besides latency or fault tolerance, launches copies in two regions? My point is that if servers need a rule in a security group, your environments are probably too connected and you will not get the benefits of having two geographical locations.
Each of the EC2 regions is isolated to help ensure decisive architectural decisions. They also want to isolate any problems with one region, which you should also strive for.
source share