# Create Security Group on AWS

A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic. When you launch an instance, you can specify one or more security groups. Each security group contains rules that allow traffic to or from its associated instances. Security groups are stateful, meaning if you allow an incoming request from an IP address, the response to that request is automatically allowed, regardless of inbound rules. This makes managing access and security for your instances both flexible and powerful.

## Procedure

The steps to create ***Security Group*** on AWS are given below.

1. Login to AWS. Navigate to the EC2 dashboard.
2. In ***Networks & Security*** section, click the ***Security Group*** and then click the ***Create Security Group***.
3. Enter the ***Name***, ***Description***, and the ***VPC*** in the associated fields to configure Security Group.
4. Set the inbound and outbound rules as per the firewall rules mentioned [here](https://docs.openg2p.org/~/changes/xKUM0sBXFkyR8F24yAMq/deployment/base-infrastructure/openg2p-cluster/cluster-setup/firewall).
5. After configuring the inbound and outbound rules, recheck the settings. Create the security group.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openg2p.org/1.3/deployment/deployment-guide/aws/create-security-group-on-aws.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
