Inbound rules can be added when launching a new EC2 instance by creating a new security group, editing the already created security groups, and adding or removing inbound rules. Inbound and outbound rules can also be added by creating a new security group directly on AWS.
Creating a Security Group
To create a security group, first, log in to the console and open the EC2 service of AWS.
In the resources, directly visit the Security groups.
Users can add inbound rules to an existing security group and can also create a new security group and add inbound rules into it. To create a new security group, click on the Create security group button displayed at the top of the screen.
Decide and type the name of the security group. Write a description. The VPC is allocated itself.
Adding Inbound Rules
To add inbound rules in the security group, scroll down and click on the Add rule option in the Inbound rules area.
Now, create an inbound rule from the combinations of given choices in the dropdowns of the options.
Add rule type, protocol to be used, port range, source, description, etc.
Users can add/create multiple rules and can also delete a rule.
After defining the permissions, there will be a Create security group button, click the button and in this way, the security group is created.
After adding the inbound rules, users can view and edit them in the list of all inbound rules.
In this way, the inbound rules are added in AWS. Users can also add outbound rules exactly the same way as explained.
When the security group is created, it can be used while launching new EC2 instances. The inbound and outbound rule permissions defined in the created security groups are used to manage the traffic of the EC2 instances.
Conclusion
The inbound rules in the AWS manage the incoming traffic. The user can add, edit and delete the inbound and outbound rules in the security groups. The user has to open and edit the security groups or create a new security group and add information like rule type, protocol, port range, etc. All the security group rules can be added and removed from the security groups at any time.