# Configuration Guide

## Codice Configuration Guide

### AWS Deployment

#### Codice AMI

A specific AMI ID containing a preconfigured Codice image will be provided. This AMI includes all the dependencies and configurations needed to run the system.

#### Instance Launch Steps

1. Access the _AWS Console_ and navigate to the _EC2_ service
2. In the left panel, select _Instances_ and click on _Launch instance_
3. For instance configuration:
   * Name: Choose a descriptive name (e.g., “Codice-Production”)
   * AMI: Use the provided AMI ID
   * Instance type: Minimum recommended t4g.large
   * Key pair: Select or create a new SSH key pair
4. For network configuration:
   * The assigned **IP MUST BE THE ONE TO BE USED** before launching the instance to **work propertly**
   * VPC: Select desired VPC
   * Subnet: Choose a public subnet
   * Security group: Configure the ports mentioned below
5. For storage:
   * Root volume: Minimum 50 GB gp3
6. Review and launch instance

### Connectivity Requirements

#### Required Ports

For Codice to function properly, the following ports need to be opened in your firewall:

| Port  | Protocol | Service          | Description            |
| ----- | -------- | ---------------- | ---------------------- |
| 30000 | TCP      | Frontend         | User web interface     |
| 30100 | TCP      | Orchestrator API | Main orchestration API |
| 30585 | TCP      | Agent Service    | Codice agent           |

#### Required External Connectivity

**AI Services**

Depending on your AI provider choice, you’ll need to enable connectivity to one of the following services for code generation and analysis:

* _Azure OpenAI_
  * Endpoint: codice-gpt4o.openai.azure.com
  * Port: 443 (HTTPS)
* _OpenAI_
  * Endpoint: api.openai.com
  * Port: 443 (HTTPS)

**Repository Services**

Access to the following container registry is required:

* _GitHub Container Registry (GHCR)_
  * Domain: ghcr.io
  * Port: 443 (HTTPS)

**Git Services**

Depending on your version control system, you must enable connectivity between your Git service and the Codice machine. For example:

* _GitHub_
  * Domain: github.com and api.github.com
  * Port: 443 (HTTPS)
* _GitLab_
  * Domain: gitlab.com (or your enterprise domain)
  * Port: 443 (HTTPS)
* _Bitbucket_
  * Domain: bitbucket.org (or your enterprise domain)
  * Port: 443 (HTTPS)

#### Network Requirements

1. _Public IP_
   * IP must be static
   * Users will need access to this IP on the specified ports
2. _DNS and Certificates_
   * It’s recommended to configure a DNS name for access

In selected repositories, user needs to have **Java version specified in pom.xml** in order for Codice to know it.
