Documentation

Oracle Cloud Infrastructure

Learn how to gain cost visibility and discover optimizations for your Oracle Cloud Infrastructure (OCI) environment with Ternary.

This document will guide a new Ternary customer through the process of providing view access of your Oracle Cloud cost and usage data to Ternary for the purpose of cost management and visibility. This is the core data set that Ternary needs in order to provide cost, usage and recommendations in our platform. To complete this guide, make sure that you are an Oracle Cloud administrator with permissions to create new user accounts and assign permissions to them.

Configuration

Step 1: Download OCI Public Key from Ternary

Once in Ternary, access the Admin page and you will see the OCI Public Key with an option to Download. Please click download to review a PEM file which is the public key Ternary will use to access your OCI cost and usage report. The public key is unique to your Ternary instance and is NOT used by other Ternary customers.

Step 2: Configure an Oracle Cloud User

This step will be configuring the Ternary service account user in Oracle cloud which will later be used in-tandem with an Oracle Group to grant access to cost and usage reports.

Login to your OCI account where you will create the user and navigate to Identity -> Domains:

Select the appropriate domain you would like to provision a Ternary service user within:

Once within the domain, select Users from the left-hand navigation and click "Create user" icon:

Please fill out the fields for the Ternary Service user account with the recommended values below.

Note, these are recommended values only allowing increased recognition by your IT and Cloud teams. You can fill in whatever details you like including a different email address that aligns with your organizational requirements. These will be ignored by Ternary and not used for any functional purpose.

You can now select the "Create User" to proceed. The user will be created, and you will be taken to the user information page. The user has a unique identifier called an OCID which needs to be configured within Ternary. Click the "Show" icon to reveal the newly created user's OCID. Copy the entire string and store it locally for set up in the final step of this guide. The string should begin with ocid1.user and end with a long string of characters.

While still on this page, we will configure key based access for Ternary. Navigate to the bottom and click "API Keys" from the left-hand navigation menu.

Select the "Add API key" icon:

Select the "Choose public key file" option and "select one" or drag and drop the PEM file that was downloaded from the Ternary admin page. You should see Ternary_OCI.pem below the Public key box if the upload was successful. Click "Add" to complete this step.

Step 3: Configure Bill Readers Group

We will create a group to put the Ternary service user into, which we will use to grant access to the Oracle Cloud Cost and Usage Reports that you (may have) just created.

Navigate back to Identity -> Domains -> (Your chosen domain) page that we used in Step 2 to create the Ternary service user. We will now want to select "Groups" from the left-hand navigation menu and click the "Create Group" icon.

We suggest naming the group BillReaders or something very similar. Next, find your newly created Ternary service user in the lower section and add it to the group right away. Select the "Create" icon to complete this step. Please keep the name of the group, you created, saved locally for ease of use in a following step.

Step 4: Enable Cost and Usage Reports

We'll be enabling Oracle Cloud Cost and Usage Reports and connecting them to Ternary. To understand how cost and usage reports work in Oracle Cloud, check the official documentation.

📘

Note: If you have already enabled cost and usage report access, you can skip this step. You can determine this by clicking the exports configuration page within Oracle Cloud. If it shows a list of CSV files that you can download, the cost and usage reports feature is already enabled and you can skip to Step 5.

However, you should work with your Oracle Cloud administrators as they may have details on how it was enabled. Regardless of when it was created, you will need to modify the policy that enables the cost and usage reports, in order to provide Ternary access to the CSV files.

Enabling cost and usage reports for Oracle Cloud involves creating a policy inside your Oracle compartment. The following URL provides the ability to create a policy if you have not already done this:

You will want to copy and save both Statement 1 and Statement 2 for easy access as you will define these statements upon creation of the new policy in the next step.

Select the "Create Policy" icon

Name the policy CostManagement, select the "Show manual editor" slider and paste Statement 1 on line 1 and Statement 2 from the previous step. Click the "Create" icon to complete this step. For Statement 2 please ensure you change to the Group name you created in Step 3. For example, BillReaders if you followed the suggestion.

Step 5: Retrieve Tenancy ID and Home Region

The final step is information gathering. Ternary will need to know your Tenancy ID and Home Region to authenticate as the service user and access the appropriate cost and usage reports in Oracle's storage bucket.

Access the Tenancy Details page within the Oracle Cloud console.

Similar to Step 2, you will see a "Profile Page" for your OCI tenancy along with an OCID field whose full contents can be revealed.

Select the "Show" link and copy the full string which should start with ocid1.tenancy and ends with a long string of characters. You will also need to copy the "Home Region" but it will need to be mapped to a machine readable region identifier. In this example, US West (San Jose) has an identifier of us-sanjose-1.

Note, if you are unsure of the region identifier for your home region of choice, please use this reference page on Oracle Cloud documentation to look it up.

Step 6: Enter values into Ternary

You can now navigate to My Ternary. In the Admin page you can Create New Cloud and choose Create Oracle Cloud. In the box that appears, fill in the information as follows:

Service User OCID: Step 2 - Configure an Oracle Cloud user
Tenancy OCID: Step 5 - Retrieve Tenancy ID and Home Region
Tenancy Region: Step 5 - Retrieve Tenancy ID and Home Region

A completed example with dummy data is shown below.


When finished entering information, press Submit to validate the connection profile in our back end. If everything is good, you should see a clean tile in your Clouds list which repeats the information you have just saved. If there are issues, you will see an error icon "<!>" next to your tile, and you will be able to hover over the tile to view the error:


If this happens, click the [...] next to your tile to Edit your configuration, and try again after reviewing the above steps.

If you need further support with Oracle Cloud Infrastructure setup, don't hesitate to reach out to our Success Team.