Security groups are virtual firewall rules that control inbound and outbound traffic to your EC2 instances. You can create security groups and specify the protocols, ports, and IP ranges that are allowed to access your instances.
Creating a Security Group:
1. Open the AWS Management Console and Navigate the EC2 dashboard.
2. From the left-hand menu, select "Security Groups."
3. Click the "Create Security Group" button.
4. Give a name and description for the security group that is created. 5. Select the VPC in which you want to create the security group.
6. Now to this security group, Add outbound and inbound rules. For each rule, specify the protocol, port range, and source (for inbound rules) or destination (for outbound rules).
7. To create the security group Click the "Create Security Group" button and the Security should have been created now!