How to create a security group with Inbound & Outbound rules in AWS EC2 Instance

To create security group with Inbound & Outbound rules in AWS EC2 Instance

Introduction:

A security group runs as a virtual firewall for the EC2 instances to regulate incoming and outgoing traffic. If we didn't define a security group, Amazon EC2 utilizes the default security group which can add rules to each security group and allows traffic to or from its associated instances. Login to your AWS account: In AWS Console management click EC2 services: Then click Instances to Launch Instances: Continue the following steps to launch Instances:

Create a new security group: Once completed connect to Instance: It will open the Linux terminal: Install httpd web server: Create a html file: Once completed go to Instances and copy the Instance Public Ip link: Open the link in browser: It will not show the content: Next, need to give Inbound and Outbound rues: Go to Security: Edit the Inbound rules: After that reload the browser It will show the content of the Instance: Edit the Outbound rules: Now, delete the default Outbound rule and check in terminal:

It will show the mirror error: Then, again add the Outbound rule and check: With this method creation of security group with Inbound & Outbound rules in AWS EC2 Instance comes to an end.

FAQ
Q
What are security groups in Active Directory?
A
Active Directory security groups include Account Operators, Administrators, DNS Admins, Domain Admins, Guests, Users, Protected Users, Server Operators, and many more. Understanding how to approach all these groups with a best-practice mindset is key to keeping your system secure.
Q
At what level do security groups provide protection in AWS?
A
Every Security Group works in a similar fashion to a firewall as it carries a set of rules that filter traffic entering and leaving the EC2 instances. As said earlier, security groups are associated with the EC2 instances and offer protection at the ports and protocol access level.
Q
Do security groups cost money AWS?
A
There is no charge applicable to Security Groups in Amazon EC2 / Amazon VPC. You can drill-down into your billing charges via the Billing Dashboard. Just click Bill Details, expand the Elastic Compute Cloud section and a breakdown of charges will be displayed.
Q
What are the features of the security group in EC2?
A
A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic. Inbound rules control the incoming traffic to your instance, and outbound rules control the outgoing traffic from your instance. When you launch an instance, you can specify one or more security groups.
Q
1)What types of rules can be defined in a security group?
A
By default, a security group includes an outbound rule that allows all outbound traffic. You can remove the rule and add outbound rules that allow specific outbound traffic only. If your security group has no outbound rules, no outbound traffic originating from your instance is allowed.