EC2: multiple IP address resolution for a security group rule

In EC2-classic, I am trying to use a security group as a source for another security group to allow access to multiple IP addresses (work and home). I am trying to make a security group named "my_ips" with one rule for each of my ip numbers (like CIDR) open to all TCP ports. Then I set up the security group: "my_sg", each rule of which has one open port (say 22), and its source is the security group "my_ips". Then I highlight 'my_sg' for my EC2 instance.

What I'm trying to avoid is setting up several rules in "my_sg" for each port, with each rule having the same port but a different IP. I try to configure the filter "my_ips" by IP, then the filter "my_sg" filters by port number.

Bad luck. It’s clear that I am doing it wrong. Is there any way to achieve what I want?

+4
source share
1 answer

You are mistaken about how security groups work. When you decide to allow SG as the source in the rule for another SG, you say that any instance of EC2 that is a member of this SG is allowed in the port you specify. This is not related to SG source rules.

, , 22 , , , . IP- .

+8

Source: https://habr.com/ru/post/1598543/


All Articles