# Manually creating aws infra

Create two instance

1. wazuh-server
2. wazuh-agent

**wazuh-agent**

```
aws ec2 create-security-group --group-name "launch-wizard-2" --description "launch-wizard-2 created 2024-12-28T06:38:29.241Z" --vpc-id "vpc-0a7d795e972934dc7" 
aws ec2 authorize-security-group-ingress --group-id "sg-preview-1" --ip-permissions '{"IpProtocol":"tcp","FromPort":22,"ToPort":22,"IpRanges":[{"CidrIp":"0.0.0.0/0"}]}' 
aws ec2 run-instances --image-id "ami-0e2c8caa4b6378d8c" --instance-type "t3.micro" --block-device-mappings '{"DeviceName":"/dev/sda1","Ebs":{"Encrypted":false,"DeleteOnTermination":true,"Iops":3000,"SnapshotId":"snap-0ea137085731e5c98","VolumeSize":20,"VolumeType":"gp3","Throughput":125}}' --network-interfaces '{"AssociatePublicIpAddress":true,"DeviceIndex":0,"Groups":["sg-preview-1"]}' --credit-specification '{"CpuCredits":"unlimited"}' --tag-specifications '{"ResourceType":"instance","Tags":[{"Key":"Name","Value":"wazuh-agent"}]}' --metadata-options '{"HttpEndpoint":"enabled","HttpPutResponseHopLimit":2,"HttpTokens":"required"}' --private-dns-name-options '{"HostnameType":"ip-name","EnableResourceNameDnsARecord":true,"EnableResourceNameDnsAAAARecord":false}' --count "1" 
```

<figure><img src="https://3155059101-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftpxp8dhlubc3j58Iygn5%2Fuploads%2F2feF4HQZn996MB88BpWd%2Fimage.png?alt=media&#x26;token=b8fad45b-4ab5-4642-b20a-793d17952faa" alt=""><figcaption></figcaption></figure>

* Proper security group rules:
  * Wazuh manager requires ports 22  and 1514.
  * Wazuh agent requires port 1514 to communicate with the manager.

<figure><img src="https://3155059101-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftpxp8dhlubc3j58Iygn5%2Fuploads%2FHorGm2olBVi63mL0OJr8%2Fimage.png?alt=media&#x26;token=d3f4cfaf-fe90-43f1-a4ca-a2d20c9e81e2" alt=""><figcaption></figcaption></figure>
