Both main_ec2
and guest_ec2
have their own security groups.
main_ec2
wants to connect to guest_ec2
on port 9012.
So I have mention port (9012) destination (guest_ec2
) rule in outbound rules of main_ec2
. Should I need to mention the another rule in the inbound of guest_ec2
to accept the traffic like port (9012) source (guest_ec2
) rule in the inbound of guest_ec2
? Or else not required to mention am inbound rule in guest_ec2
?
CodePudding user response:
If you want main_ec2
to be able to access guest_ec2
on port 9012, then the configuration should be:
Security group on main_ec2
:
- Permit Inbound access as necessary for your application (and presumably SSH)
- Leave the Outbound rules as the default "Allow All" rules because you can normally trust your own system
Security group on guest_ec2
:
- Permit Inbound access on port 9012 from the Security Group on
main_ec2
(that is, it should specifically refer to the other Security group) - Leave the Outbound rules as the default "Allow All" rules because you can normally trust your own system