AWS Security Group Rules (Allow Ip address and port numbers using the AWS security group)

Amazon EC2 Security Groups for Linux Instances. A security group acts as a virtual firewall that controls the traffic for one or more instances. When an instance is launched, you associate one or more security groups with that instance. The rules of a security group controls the inbound traffic that’s allowed to reach the instances that are associated with the security group and the outbound traffic that’s allowed to leave them.

aws-security-group-rules

Follow the steps below to allow ip address in the instance security group:

1. To create a security group, open the Amazon VPC console at: https://console.aws.amazon.com/vpc/.

2. In the navigation pane, choose Security Groups.

3. Choose Create Security Group.

4. Enter a name of the security group (for example, my-security-group) and provide a description. Select the ID of your VPC from the VPC menu and choose Yes, Create.

aws-create-security-group-rules

By default, new security groups start with only an outbound rule that allows all traffic to leave the instances. You must add rules to enable any inbound traffic or to restrict the outbound traffic.

Adding and Removing Rules:

1. To add a rule, open the Amazon VPC console at: https://console.aws.amazon.com/vpc/.

2. In the navigation pane, choose Security Groups.

3. Select the security group to update. The details pane displays the details for the security group, plus tabs for working with its inbound rules and outbound rules.

4. On the Inbound Rules tab, choose Edit. Select an option for a rule for inbound traffic for Type, and then fill in the required information. For example, for a public web server, choose HTTP or HTTPS and specify a value for Source as 0.0.0.0/0. Choose Save.

aws-inbound-rules

Note:

If you use 0.0.0.0/0, you enable all IPv4 addresses to access your instance using HTTP or HTTPS. To restrict access, enter a specific IP address or range of addresses.

You can also allow communication between all instances associated with this security group. On the Inbound Rules tab, choose All Traffic from the Type list. Start typing the ID of the security group for Source, this provides you with a list of security groups. Select the security group from the list and choose Save.

If you need to, you can use the Outbound Rules tab to add rules for outbound traffic.