# Connect to Oracle

## Oracle Integration Overview

{% hint style="warning" %}
**Note**: This topic covers a new capability that is currently in beta and will replace the existing topic in the future. If this functionality is not yet available in your account, contact Finout support at <support@finout.io> to enable it.&#x20;
{% endhint %}

Integrating Finout with Oracle Cloud Infrastructure (OCI) allows you to ingest, analyze, and optimize your Oracle cloud costs within Finout. Once connected, you can track OCI usage, monitor spending trends, allocate costs across teams and cost centers, and gain full visibility into your Oracle environment alongside your other cloud providers.

Finout supports two integration methods:

* [**Console-Based Integration**](#console-based-integration) – Manual setup through the OCI Console.
* [**CLI-Based Integration**](#cli-based-integration) – Automated setup using the Oracle CLI, recommended for faster onboarding and repeatable configuration.

This guide walks you through both methods so you can choose the approach that best fits your organization’s security model and operational preferences.

## Console-Based Integration

### 1. Create a New Group for Finout <a href="#h_60fc961389" id="h_60fc961389"></a>

Access permissions in Oracle are assigned to groups. Create a separate group for Finout to ensure access only to the necessary billing resources.

1. Go to the OCI navigation menu → **Identity & Security** → **Domains** → \<Finout domain> → **Groups** (in the right-hand menu).

{% hint style="info" %}
**Note**: If you choose to use a domain other than “Default” to set up the integration user make sure that both the user and group are contained in the same domain.
{% endhint %}

<figure><img src="https://finout.intercom-attachments.eu/i/o/14463067/4be11f5640765680c1dadeca/AD_4nXfvsIaEVGg3UntNiRhsj6j-_uuQ6UKfrXss-VDdH-tWPEPFxLhNKUonfccXQU57LF9gUdGjF2dIIhVM3C0cwgZPL2Lm9SWSrgLFS7tS2g6DQi62PGkZI8sQU38IIeZwlG1jMb7y6iyfObrADD4zSfGlKpyk?expires=1725534000&#x26;signature=9b9f17f49bb22d65b5bd9e5a485dc00281c468e9cc58d1f644a625973c5424a9&#x26;req=0dFrw1v6qjBk2hL085ZhoQX35blI%2FV%2BYfpBCCo79HpZWQKT%2BXPRZKUCcBl3n%0A8Q%3D%3D%0A" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FeDTAJJGHhVGu7lj0E3Bi%2Fimage.png?alt=media&#x26;token=e8b54e74-ec5b-445b-8716-e791f684731d" alt=""><figcaption></figcaption></figure>

2. Click **Create Group**.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FRbLE03oxgoAH0TyvXYHh%2Fimage.png?alt=media&#x26;token=60f50ba0-fb7a-4f01-8c54-1207c1b74499" alt=""><figcaption></figcaption></figure>

<div data-full-width="true"><figure><img src="https://finout.intercom-attachments.eu/i/o/14463069/4f72503e08fef4704138a914/AD_4nXc17WtjbFCMXWeMcZado1ACBPgVGlyNSk8IHUcYA7y3aYODeRbPQmbM6ayXAZt90rVZqoqCK2dI41VBhDEY4KKWyx9_swW2jgI_v5p2l6I7iC1O680yYMhbf1Uk_q6DHTjUZg6Uzw-7KBqurU9y06JjdLCw?expires=1725534000&#x26;signature=70e39f5b95e357b0e775fc3cf7dc18a946b5029bec4cc646889cefae5733991c&#x26;req=0dFrw1v6qj5k2hL085Zhodd0k%2F6aFe4CDYe4vLhW3I2ScstyLAH2kLK7%2F%2BYx%0ADQ%3D%3D%0A" alt="" width="563"><figcaption></figcaption></figure></div>

3. Fill in the **Group Name** and add some **Description**.<br>

   <div align="left"><figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FmZS67wlql11d0ddJZulK%2Fimage.png?alt=media&#x26;token=566ae309-6fee-41ad-8cc4-08cebd7cf5e2" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://finout.intercom-attachments.eu/i/o/14463072/8d578f985b5f8fc3d5d87939/AD_4nXfI6-_yhwYpqqo2KG-Jki1eetn5bqVFFiJvB8mKMuu-PxkMD0a_Uz-AwPPxdm9XikwLE9B5eZNe8uro1atJ8aCQdwmYbkgGPNwDcBhtFS9n5mckMyFBQC7iTLOuqmHNFzLuzftDA-EA7VefQjQpGdzfkExJ?expires=1725534000&#x26;signature=4fc2ef68acae443b94e574188e53053c5dfa14d1e33fc2de59c737470908ed08&#x26;req=0dFrw1v6qzVk2hL085ZhoU%2BlrcMGhV82yiTMOpBaiIQyRyDf0fN5sSZDq74q%0Afg%3D%3D%0A" alt="" width="563"><figcaption></figcaption></figure></div>

4. Click **Create.**

### 2. Add a Policy to a Group <a href="#h_4d3b21f51f" id="h_4d3b21f51f"></a>

Assign a policy to the group for accessing cost reports. In OCI, group permissions are managed through policies. By assigning a policy to the Finout group, you ensure that all its members can access only what the group policies allow.

1. Go to the OCI navigation menu → **Identity & Security** → **Policies**.

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FJ68yP0nUUuJ17ahO21EC%2Fimage.png?alt=media&#x26;token=5eda4318-5a48-4320-a060-93d79399a838" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://finout.intercom-attachments.eu/i/o/14463073/0fb7e6fa0e989d664b03c010/AD_4nXcU6DJLvzohT8PhQwvRaz1FU89HOnaSvIBi0Fb7_MkiNr6JFTsF6_9iGNzDxL2RRxd-JnpZuUgqdpLrdvMCeic1Vjo1EAc7SNnQcCMklva66-ufwdW14b6UHRME6DsSJcEK-v68OsqUmTrXxzgr?expires=1725534000&#x26;signature=eaac27ef91fcd6933a3c8ad6b38861e563618fa93272807b4c73f81eacc6eaef&#x26;req=0dFrw1v6qzRk2hL085ZhoUzyIrlqRO0gm91LQAw2kA45KL80arqiBO7eWOer%0AMQ%3D%3D%0A" alt=""><figcaption></figcaption></figure>
2. Click **Create policy**.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FKNmQF4pIDIuC8bp9rHBC%2Fimage.png?alt=media&#x26;token=d1c2d75c-4582-40de-841a-658219fb56ea" alt=""><figcaption></figcaption></figure>
3. Choose a **name** for the policy that clearly indicates its purpose for accessing cost reports.
4. In the policy builder box at the bottom of the screen, activate the **Show manual editor** button and enter the following statements:

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: Save your tenancy for step 5.</p></div>

   * Statement 1:

     <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Important</strong>: The following statement is not an example. You need to run this statement exactly as it is shown below.</p></div>

     \
     \&#xNAN;*`define tenancy usage-report as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr56u7cj63lf3wffbilvqknstgtvzub7vhqkggq`*\
     This specifies the tenancy for usage reports, which is in a bucket owned by Oracle.
   * Statement 2:\
     \&#xNAN;*`endorse group <group name> to read objects in tenancy usage-report`*\
     Replace *`<group name>`* with the name of the group created for Finout. If you want your own groups/users to access the cost reports as well, add another policy with the relevant *`<group name>`*.

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Examples:</strong> <br></p><ul><li>If you chose the “Default” domain:<br><code>endorse group default to read objects in tenancy usage-report</code></li><li>If you chose a custom domain named “finoutdomain”:<br><code>endorse group finoutdomain/default to read objects in tenancy usage-report</code></li></ul></div>
5. Click **Create**.

   <figure><img src="https://finout.intercom-attachments.eu/i/o/14463075/5b7639d95fc9cf092f98611a/AD_4nXehwyijWq7DZSUxpjgQhh81V7rBknNEuP5-cQ8cmCcEn1o0zkBIZnwzPeW9leHxjZxug1kRCl1beZ1aVuZ38YQQDDldLGNEuwmFGrBtlT-U3aaimvU9gcd-vvdDa7UZ5sorJL4v-aFH5h8mZ1o5Px3OGN51?expires=1725534000&#x26;signature=a6a90786554a190709b41052e4cf3a4d13c7213fd374d444c21605c3cfa1f670&#x26;req=0dFrw1v6qzJk2hL085ZhoeVQCixmHXHUwkD%2BvfmxLghNcK26Kl8lQ5M0jZdK%0AQQ%3D%3D%0A" alt=""><figcaption></figcaption></figure>

### 3. Create a User for Finout <a href="#h_44220cee8f" id="h_44220cee8f"></a>

1. Go to the OCI navigation menu → **Identity & Security** → **Domains** → **Users**.

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FIXUbGoPJViykwTgPE8iI%2Fimage.png?alt=media&#x26;token=3ad3b4f7-7bab-4443-944f-7ed412a19825" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://finout.intercom-attachments.eu/i/o/14463076/01711405b8a7804b0eecd532/AD_4nXdKRDIy6fJ_eUngDI4uaL09PMbKW7PwROG1fMgbACzsv7QEeGQMgOsQgriIec4VEJ3gnGN9Now6dmDLm2xIGAZtBjsqpcQjxlTvqcYmp1ijJClUI7WzXXQvNolzMvTUWPMvUhN6LTwLsJUJaW8E9te8wn4p?expires=1725534000&#x26;signature=75f33c3ad2a13b7f6fe02194e3379bd4ac7c17f9ed069ed2fe793775e786504e&#x26;req=0dFrw1v6qzFk2hL085ZhoVGKlX3vpEO1KXQpjvCajDu0MZLTxrd1vA9gC7%2BY%0AJA%3D%3D%0A" alt=""><figcaption></figcaption></figure>
2. Click **Create User**.

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FXdKeXtEcRddw7kWhzKZq%2Fimage.png?alt=media&#x26;token=3e87baa3-c164-4e9f-9342-adcf9bc7888d" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://finout.intercom-attachments.eu/i/o/14463078/3bbcdcd927cccae0ec4e1b16/AD_4nXd-sBdDk6dQ-9Gr10jtOszJUopXB74QbqMGFPj1Y5owl9w4vA4S-WLotguNP4Sl5JSxN0D5RBcFBkJR206q1sMvi24eub_TfBTVm8zgrkGbsmQcX1Bs8M2B-t1yj6OglTdh_M6NQcQkNuohuSm2HEsEIWto?expires=1725534000&#x26;signature=16e2889fe324114cd54ab24158aef5c61ef8139ad5703cb2e59180b85c2ec7e5&#x26;req=0dFrw1v6qz9k2hL085ZhoUR2KTLEvG0c5C24vSA9OZdKLE6e1%2BiOy0WdhxHj%0AgA%3D%3D%0A" alt=""><figcaption></figcaption></figure>
3. Fill in the name and email of the Finout user.
4. Assign the user to the new Finout group you created in [step 1](#h_60fc961389) by selecting the appropriate box under the **Groups** section.

{% hint style="info" %}
**Note**: This setup ensures that a Finout user will have access only to the specified policies, specifically the cost reports bucket. It's important to avoid selecting the administrator option and instead choose only the group dedicated to Finout for proper access control.
{% endhint %}

5. Click **Create**.<br>

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: You can Edit the user capabilities and limit to only API keys.<br><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FC3pjHPSvbGkgN7nORKyM%2Fimage.png?alt=media&#x26;token=8c9db51d-4a7e-40f7-b51e-d9733d5612d5" alt=""></p></div>

### 4. Generate an API Key <a href="#h_cdbaad95f1" id="h_cdbaad95f1"></a>

Generate an API key to enable Finout users to access the reporting bucket via the Oracle API key.

For detailed instructions, refer to the official Oracle documentation [here](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#two).

**Create an API key pair in the OCI console to enable API signing for the Finout user:**

1. Ensure an administrator user is logged into Oracle, as only administrators can perform these steps.
2. Navigate to **Identity & Security** → **Domains** → \<Finout user domain> → **Users**, and click the Finout user to access their profile.

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FpPYUlxrhVlEScOuBKnKQ%2Fimage.png?alt=media&#x26;token=cf2dcbe1-b3ef-4f22-936d-4cd8077edb3f" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://finout.intercom-attachments.eu/i/o/14463081/548446bc92c9775810c47db7/AD_4nXdKRDIy6fJ_eUngDI4uaL09PMbKW7PwROG1fMgbACzsv7QEeGQMgOsQgriIec4VEJ3gnGN9Now6dmDLm2xIGAZtBjsqpcQjxlTvqcYmp1ijJClUI7WzXXQvNolzMvTUWPMvUhN6LTwLsJUJaW8E9te8wn4p?expires=1725534000&#x26;signature=b95acf14f13fb9a767dafa4d5da41bc6cc6967bf723ed50469495c190cfdab53&#x26;req=0dFrw1v6pDZk2hL085ZhoUh%2BQKUwVzKuYnPTlSd8o%2Fi8vVuWxhRTqykLkQTA%0AbA%3D%3D%0A" alt=""><figcaption></figcaption></figure>
3. Navigate to the **Resources** section in the bottom left screen and select **API keys**.

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FNOZiKOIwzMWdiY8W9hOk%2Fimage.png?alt=media&#x26;token=94a3f72e-d597-4270-9d2e-576f46a14aed" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://finout.intercom-attachments.eu/i/o/14463083/8cc9280debc89313981d1959/AD_4nXeZmESJ42kCo2lznGUNuBaNNgUkJc1HIw0UL2nMuRvNiEm3krJdmlbvLEpMNCleOMC0JNLujQ6XojtrurQBGsfJSK7NhscRbv5WPPQXDa0oUkFqrUXIn9Kw92Swlj9DPk5k4rprlp55lGBiToJsPwMI1Ssz?expires=1725534000&#x26;signature=60e1a49f43232e0fc362b49c8da20a472a7c34e96ee9740da428d348555c302f&#x26;req=0dFrw1v6pDRk2hL085ZhoYqL2%2F6JqiWMjDYm5267Fx%2Bb2StmPxLjpx6Jrbhv%0AqQ%3D%3D%0A" alt=""><figcaption></figcaption></figure>
4. Make sure that the **Paste a public key** pair is chosen.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FOsvn9l7v9A18zrj15XBX%2Fimage.png?alt=media&#x26;token=27881cb2-1235-4e85-bc2b-123de82d1f17" alt=""><figcaption></figcaption></figure>
5. Click **Download Private Key** and save the key in a local directory.
6. A configuration is displayed. Click on the copy button below the text box and paste it into a local file editor (save for step 5). <br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FSkN7fOxC9YkyQniPqKSz%2Fimage.png?alt=media&#x26;token=f93f4b8f-e92f-4835-b8da-dc6ca176a9ee" alt=""><figcaption></figcaption></figure>

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: The Oracle <a href="https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#two">documentation</a> offers alternative methods for generating the key. Ensure that you have the complete configuration details as outlined in the following step.</p></div>

### 5. Generate a Public Key from Finout

1. In Finout, navigate to **Settings > Cost Centers** and click **Add cost center**.\
   The **Connect Accounts** window appears.

   <figure><img src="https://downloads.intercomcdn.eu/i/o/wkjhtykk/25585922/4b5e7a3b349798fd5bf943b4941d/AD_4nXdGWDFdxxLmwDujPD6A0oehRHTPOj9Y9drPM30Fi5F6DqRk_GrU4sdEO9VFnGPqtKGFbMkcHC0B_OQaBJEZTsd4RcaPwOJIM5l1aeEZ2X-Pa1S5VN95N2oXRhyN4x5Qfme71oUdYw?expires=1732627800&#x26;signature=8f85b7d764f840abf0cec93382a4eac3cccb27a070cd9ed8a2b077ca5fc61079&#x26;req=0tBqzV3zrjVk2hL085ZhoXj2%2FgsqWaK0q2sUm17ISIl%2FqBh171RT13I7rnYv%0Ayg%3D%3D%0A" alt=""><figcaption></figcaption></figure>

2. In **Oracle Cloud**, click **Connect Now**.\
   The **Select connection method** appears.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FI68DC1ZTh25QVRuWPSJc%2Fimage.png?alt=media&#x26;token=61e71689-a9d3-40f4-a27c-cff8f9f8c180" alt=""><figcaption></figcaption></figure>

3. Select **Console**.\
   You are brought to the **Connect to OCI** step.

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FpobUJ2uZ8BZEa4Ursw9R%2Fimage.png?alt=media&#x26;token=681bd042-bcd1-4cf0-ac31-c8c5f020631a" alt=""><figcaption></figcaption></figure>

4. Copy the **Public key** and return to Oracle.

### 6. Obtain the Configuration File Information

<figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FkbnHVigULcPEqEGT2J74%2Fimage.png?alt=media&#x26;token=af8580bc-3765-4716-ae2f-87ea6a829b0a" alt=""><figcaption></figcaption></figure>

1. Click **Add API Key**.

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2F0mBtD8ooCKzjS3DGsQfN%2Fimage.png?alt=media&#x26;token=d5707b4d-9ecb-430e-8ed0-9dd5afd25977" alt=""><figcaption></figcaption></figure>
2. **Paste the Public key** obtained from Finout in the previous step.
3. A configuration is displayed. Click on the copy button below the text box and paste it into a local file editor (save for the next step).

   <figure><img src="https://finout.intercom-attachments.eu/i/o/14463087/364b94bb9f65435735f3b6c7/AD_4nXcVurWnX6LY3sXBFFdkuCZIxp4fumS-pbIs_wUyjOMY1ufMI0RZKalHeH_BhMIydcmgkB3P3QLSL7kLZvhxhVjbY_VUmDkXuXXw1khQ-rBEbjiNPw4QkgakFPsUSnp9YdHMnj-2q91Mhf07NkLnMgNdFnlA?expires=1725534000&#x26;signature=fbccc4484e4adbf98350d7a8d81c66a4db036723fb761231ffab13e454a49699&#x26;req=0dFrw1v6pDBk2hL085ZhoSw9YXaAlJaJfGVDSH2F5jgznazMJ0gEXhkzUKYz%0AqA%3D%3D%0A" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note**: The Oracle [documentation](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#two) offers alternative methods for generating the key. Ensure that you have the complete configuration details as outlined in the following step.
{% endhint %}

### 7. Integrate Oracle with Finout <a href="#h_bf23787458" id="h_bf23787458"></a>

<figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FpobUJ2uZ8BZEa4Ursw9R%2Fimage.png?alt=media&#x26;token=681bd042-bcd1-4cf0-ac31-c8c5f020631a" alt=""><figcaption></figcaption></figure>

1. Back in Finout, fill in the relevant fields from the "Configuration file preview" text box that you copied in the previous step. &#x20;

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: Finout generates the key pair for you. Finout securely stores the private key, and you receive the public key, which you can copy and paste into the OCI Console.</p></div>
2. Click **Complete Integration**.\
   The cost center is created.

## CLI-Based Integration

{% hint style="info" %}
**Note**: The CLI script is currently supported on macOS and Linux only. If you are using Windows, please follow the Oracle Console setup instead.
{% endhint %}

### 1. Select Connection Method

1. In Finout, navigate to **Settings > Cost Centers** and click **Add cost center**.\
   The **Connect Accounts** window appears.

   <figure><img src="https://downloads.intercomcdn.eu/i/o/wkjhtykk/25585922/4b5e7a3b349798fd5bf943b4941d/AD_4nXdGWDFdxxLmwDujPD6A0oehRHTPOj9Y9drPM30Fi5F6DqRk_GrU4sdEO9VFnGPqtKGFbMkcHC0B_OQaBJEZTsd4RcaPwOJIM5l1aeEZ2X-Pa1S5VN95N2oXRhyN4x5Qfme71oUdYw?expires=1732627800&#x26;signature=8f85b7d764f840abf0cec93382a4eac3cccb27a070cd9ed8a2b077ca5fc61079&#x26;req=0tBqzV3zrjVk2hL085ZhoXj2%2FgsqWaK0q2sUm17ISIl%2FqBh171RT13I7rnYv%0Ayg%3D%3D%0A" alt=""><figcaption></figcaption></figure>

2. In **Oracle Cloud**, click **Connect Now**.\
   The **Select connection method** appears.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FftCTfN1MPj2kQ7ObgL9S%2Fimage.png?alt=media&#x26;token=2053b5fc-f8aa-42b5-ab09-e1fdf84ce931" alt=""><figcaption></figcaption></figure>

3. Click **CLI**.\
   You are brought to the **Set Up CLI Parameters**.

### 2. Install and Authenticate the CLI

1. Install OCI command line as instructed in the [Oracle official docs](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm). Skip this step if you already have the OCI command line installed.
2. Authenticate. You have two options:
   * Follow the authentication guide in the [Oracle official docs](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile).
   * Authenticate using the browser by running `oci session authenticate`\ <br>

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: Before running the authentication command, ensure that any existing OCI configuration files are removed, as they may have been left over from a prior integration run.</p></div>

     1. This will open a browser window in which you will need to authenticate.
     2. Once authentication is complete, you will have a file named `rm -rf ~/.oci/config` containing all the necessary configuration, including a temporary authentication token.
3. Run a small test to see if you are authenticated:
   * oci --auth security\_token iam availability-domain list
4. Choose the domain
   1. Print domains

      ```
      OCI_TENANCY=$(awk -F'=' '/^tenancy/ { gsub(/ /, "", $2); print $2; exit }' ~/.oci/config) && \
        oci iam domain list \
        --compartment-id "$OCI_TENANCY" \
        --all \
        --auth security_token \
        --query 'data[].{name:"display-name", id:id, url:url}' \
        --output table
      ```
   2. Ensure that it looks like:

      ```
      +--------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------+
      | id                                                                             | name        | url                                                                        |
      +--------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------+
      | ocid1.domain.oc1..aaaaaaaaxnavpemxob22rbpw73f77kplggcozle5pppj6prsdznykjp2urbq | Default     | https://idcs-d24ab4d562c6425398a8ddf963660fbf.identity.oraclecloud.com:443 |
      | ocid1.domain.oc1..aaaaaaaa46euetfik5sqk4zvnia7v6l2kpb3cgypzd4bmhpmwi2rvhqnztha | finout-cost | https://idcs-6bd3f87141924f1995523f8ec5662c67.identity.oraclecloud.com:443 |
      +--------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------+
      ```
   3. Pick one and use it below as OCI\_DOMAIN\_NAME.
5. A key is generated:
   * The public key will be used as the value in FINOUT\_PUB\_KEY.
   * The private key will be saved when saving the credentials to the cost center to authenticate in the data pipelines.
6. Provide the input details as instructed previously, then run the script provided below.

   Once the execution is complete, please review the results and extract the necessary details from the output, as shown in the example format:<br>

   ```
   -----------------------
   User ID: ocid1.user.oc1..aaaaaaaaj7xn352us5bj74ew4pfkkebfbtrsfkgnhbmbikofdprpdavzca4q
   API Key fingerprint: 6e:b5:43:46:aa:6e:6f:0d:50:68:f6:f2:a6:f0:4e:bb
   Tenancy: ocid1.tenancy.oc1..aaaaaaaalzf62oj3gqksyjc6jiee7na3m7ne7ebvecslrbk6xfhqgrlqbrka
   Region: us-ashburn-1
   -----------------------
   ```
7. Fill the form.

### 3. Set Up CLI Parameters

<div align="left"><figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FuSAKT3x3uwa8xnajgPOl%2Fimage.png?alt=media&#x26;token=78372c36-225f-41f9-86d7-48f39daca235" alt=""><figcaption></figcaption></figure></div>

1. In Finout, review and adjust the CLI parameters below, then run the generated script.
2. Update the editable fields at the top of the script:

   * FINOUT\_USERNAME - ask the user for the name of the user we will create for him.
     * Can only contain: A-Z, a-z, 0-9, hypen(\`-\`), period(\`.\`), underscore(\`\_\`), plus sign (+) and at sign (@)
   * FINOUT\_EMAIL - ask the user for the email for the user we will create for him
     * Make sure it’s a valid email
   * FINOUT\_FIRST\_NAME and FINOUT\_LAST\_NAME - same
   * GROUP - IAM group name they wish to create the use at:
     * Choose a group name, but it must consist of letters, numbers, dots, dashes, and underscores.
   * OCI\_POLICY\_NAME - Policy name they wish to create (this is the one that allows the group to read the OCI usage reports)
   * FINOUT\_PUB\_KEY-
     * Generate a pair of public/private keys, similar to those commands:
       * z - this creates a private key file
       * openssl rsa -pubout -in finout\_user\_private.pem -out finout\_user\_public.pem - this extracts the public key from the private key file.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: Group names may contain only letters, numbers, dots (.), dashes (-), and underscores (_).</p></div>
3. Copy the generated script. Run this script in your terminal to set up the OCI integration.&#x20;
4. Click **Next**.

### 4. Run the Script in the CLI

1. Copy and run the script below into a file called oci-setup.sh (this contains your own specific one-time public key in the script):\
   `chmod +x oci-setup.sh`\
   `./oci-setup.sh`\
   \ <br>

This option uses a single CLI script to automatically create all required OCI resources, reducing setup time and minimizing configuration errors.

**What the script does:**

* Creates or reuses an IAM group
* Creates or reuses a read-only IAM policy for cost and usage reports
* Creates or reuses an IAM user in the selected identity domain
* Adds the user to the group
* Uploads the public API key provided by Finout
* Outputs all required identifiers for Finout

{% hint style="info" %}
**Note**: If resources already exist, they will be reused. If not, they will be created.
{% endhint %}

2. Copy the following values from the CLI script:

* User ID
* API Key Fingerprint
* Tenancy
* Region

### 5. Connect to OCI

<div align="left"><figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2Fk3Rfc054BUutj3jz1x8u%2Fimage.png?alt=media&#x26;token=b7e71550-3ff9-457c-b3ff-1524247ec048" alt=""><figcaption></figcaption></figure></div>

1. Back in Finout, fill in the values from the CLI.
2. Click **Complete Integration**.\
   The integration is completed.


---

# 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.finout.io/billing-integrations/cloud-providers/connect-to-oracle.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.
