> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formae.io/llms.txt
> Use this file to discover all available pages before exploring further.

# OCI configuration

> Configure an OCI target for formae: credentials and target settings.

The OCI plugin enables formae to manage Oracle Cloud Infrastructure resources.

## Configuration

### Target

Configure an OCI target in your Forma file:

```kotlin theme={"languages":{"custom":["/languages/pkl.json"]}}
import "@formae/formae.pkl"
import "@oci/oci.pkl"

target: formae.Target = new formae.Target {
    label = "oci-target"
    config = new oci.Config {
        region = "us-ashburn-1"
        profile = "DEFAULT"  // Optional: profile from ~/.oci/config
    }
}
```

**Config field mutability:**

| Field            | Mutable | Description                                                                                             |
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| `profile`        | Yes     | Changing the profile updates the target in place                                                        |
| `configFilePath` | Yes     | Changing the config file path updates the target in place                                               |
| `region`         | No      | Changing the region triggers a full [target replace](/documentation/concepts/target#replacing-a-target) |

See [Target](/documentation/concepts/target) for details on per-field config mutability.

### Credentials

The plugin uses the OCI SDK's default config provider, which tries the following methods in order:

**Config file (`~/.oci/config`):**

```ini theme={"languages":{"custom":["/languages/pkl.json"]}}
[DEFAULT]
user=ocid1.user.oc1..aaaaaaaexample
fingerprint=12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef
tenancy=ocid1.tenancy.oc1..aaaaaaaexample
region=us-ashburn-1
key_file=~/.oci/oci_api_key.pem
```

**Environment variables:**

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
export OCI_CLI_USER="ocid1.user.oc1..aaaaaaaexample"
export OCI_CLI_TENANCY="ocid1.tenancy.oc1..aaaaaaaexample"
export OCI_CLI_FINGERPRINT="12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef"
export OCI_CLI_KEY_FILE="~/.oci/oci_api_key.pem"
export OCI_CLI_REGION="us-ashburn-1"
```

**Instance principal (on OCI Compute):**

When running on OCI compute instances, credentials are automatically retrieved from the instance metadata service.
