Connect an OCI Tenancy

In this guide, you will connect your Oracle Cloud Infrastructure (OCI) tenancy to Turbot Guardrails using the Create Connection wizard. The wizard validates your API key credentials, tests connectivity to your tenancy, and imports your tenancy, all in a single flow.

Once connected, Guardrails automatically discovers all compartments and regions within your tenancy hierarchy, giving you full visibility into your OCI environment.

Prerequisites

ValueWhere to Find It
Tenancy OCIDOCI Console > Profile > Tenancy > copy the OCID
User OCIDOCI Console > Identity > Users > select the API user > copy the OCID
API Key FingerprintDisplayed when you upload the public key to the user's API Keys
Private KeyThe PEM-encoded private key from your API signing key pair
Home RegionOCI Console > Administration > Tenancy Details > Home Region

[!IMPORTANT] The API user must have sufficient IAM policies in OCI to read resources across the tenancy. At minimum, the user needs inspect all-resources in tenancy and read all-resources in tenancy. For full governance capabilities including tagging and remediation, grant manage all-resources in tenancy.

Step 1: Open the Create Connection Wizard

From the Accounts page, click Create Connection in the top right corner.

Step 2: Select a Provider

The wizard displays a grid of available cloud providers. Each provider shows an Installed badge indicating whether the corresponding mod is available in your workspace.

Select OCI from the provider grid.

Provider selection grid showing AWS, Azure, GCP, OCI, and other providers with Installed badges

[!NOTE] OCI supports only one connection type: OCI Tenancy. Unlike AWS or Azure, there is no option to connect an individual compartment. Compartments are automatically discovered as child resources of the tenancy.

Step 3: Enter OCI Credentials

The wizard presents a 4-step process. Step 1 collects your OCI API key credentials.

Wizard step 1 showing OCI Credentials with Tenancy OCID, User OCID, API Key Fingerprint, Private Key, and Home Region fields

FieldDescription
Tenancy OCIDThe OCID of your OCI tenancy (e.g., ocid1.tenancy.oc1..aaaaaaaax7fk3...).
User OCIDThe OCID of the OCI user with API key credentials (e.g., ocid1.user.oc1..aaaaaaaab9exa...).
API Key FingerprintThe fingerprint of the API signing key uploaded to the user (e.g., a1:b2:c3:d4:e5:f6:...).
Private KeyThe PEM-encoded private key for API signing. Paste the full key including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- markers.
Home RegionSelect the home region of your tenancy from the dropdown (e.g., US East (Ashburn)). This is the region where IAM resources are mastered.

Enter your credentials and click Continue.

Wizard step 1 with credentials filled in: Tenancy OCID, User OCID, and Fingerprint visible, Private Key in text area

[!NOTE] The Private Key is stored securely by Guardrails and used to sign API requests to your OCI environment. Guardrails generates short-lived session tokens from these credentials. The original key is never passed directly to mods.

Step 4: Test Connectivity

After entering credentials, the wizard presents a Test Connection step. Click Test Connection to verify that Guardrails can authenticate to your OCI tenancy using the provided credentials.

On success, an alert displays your Tenancy Name and Home Region code.

Wizard step 2 showing Test Connection with Connectivity Verified alert displaying Tenancy Name and Home Region

Click Continue to proceed.

[!TIP] If the connectivity test fails, verify that:

Step 5: Choose Destination Folder

Choose where to place this connection in your Guardrails resource hierarchy.

Wizard step 3 showing Destination Folder selection with OCI folder selected

Select an existing folder from the Destination Folder dropdown, or click Create Folder to create a new one. While you can import an OCI tenancy at the Turbot level, it is recommended that you import into a Guardrails folder, as it provides greater flexibility and ease of management.

Click Continue to proceed to the review step.

Step 6: Review and Connect

The final step shows a summary of your configuration:

  1. OCI Credentials: Tenancy OCID, User OCID, Fingerprint, and Home Region
  2. Tenancy: Tenancy Name and verification status
  3. Destination Folder: Where the connection will be placed

Wizard step 4 showing review summary with OCI credentials, tenancy verification status, and destination folder

Review the details and click Create Connection to start the import.

Step 7: Monitor Discovery Progress

After connecting, you're redirected to the Organization Overview page. A Discovering Resources banner shows real-time progress as Guardrails discovers your tenancy structure.

Organization overview page showing Discovering Resources banner with progress indicators

Guardrails processes the tenancy from the root down, discovering compartments and regions. You can click Refresh now to update the progress display, or wait for it to update automatically.

[!NOTE] Discovery typically takes a few minutes depending on the size of your tenancy. You don't need to wait. You can navigate away and come back later.

What Gets Discovered

Once the tenancy is connected, Guardrails automatically discovers:

ResourceDescription
CompartmentsAll compartments in the tenancy hierarchy, including nested compartments.
RegionsAll subscribed regions within the tenancy.
ResourcesResources within each compartment when the corresponding service mods are installed (compute instances, storage buckets, VCNs, IAM users, etc.).

The compartment hierarchy in OCI is analogous to the organizational unit (OU) structure in AWS. Compartments can be nested, and Guardrails tracks the full parent-child relationship.

Import via Terraform

Administrators can import a tenancy using Terraform. If your Terraform environment has not been set up, head over to the Terraform Setup Page.

# Create the OCI > Tenancy resource in Guardrails
resource "turbot_resource" "tenancy_resource" {
  parent = var.parent_resource
  type   = "tmod:@turbot/oci#/resource/types/tenancy"
  metadata = jsonencode({
    "oci" : {
      "tenancyId" : "ocid1.tenancy.oc1..your-tenancy-ocid"
    }
  })
  data = jsonencode({
    "id" : "ocid1.tenancy.oc1..your-tenancy-ocid"
  })
}

# Set the credentials for the Tenancy via Guardrails policies

resource "turbot_policy_setting" "oci_tenancy_ocid" {
  resource = turbot_resource.tenancy_resource.id
  type     = "tmod:@turbot/oci#/policy/types/ociConfigTenancyOcid"
  value    = "ocid1.tenancy.oc1..your-tenancy-ocid"
}

resource "turbot_policy_setting" "oci_user" {
  resource = turbot_resource.tenancy_resource.id
  type     = "tmod:@turbot/oci#/policy/types/ociConfigUserOcid"
  value    = "ocid1.user.oc1..your-user-ocid"
}

resource "turbot_policy_setting" "oci_fingerprint" {
  resource = turbot_resource.tenancy_resource.id
  type     = "tmod:@turbot/oci#/policy/types/ociConfigFingerprint"
  value    = "a1:b2:c3:d4:e5:f6:a7:b8:c9:d0:e1:f2:a3:b4:c5:d6"
}

resource "turbot_policy_setting" "oci_private_key" {
  resource = turbot_resource.tenancy_resource.id
  type     = "tmod:@turbot/oci#/policy/types/ociConfigPrivateKey"
  value    = file("~/.oci/oci_api_key.pem")
}

resource "turbot_policy_setting" "oci_home_region" {
  resource = turbot_resource.tenancy_resource.id
  type     = "tmod:@turbot/oci#/policy/types/ociConfigHomeRegion"
  value    = "us-ashburn-1"
}

Troubleshooting

IssueSolution
Create Connection not availableEnsure you have Turbot/Admin or Turbot/Owner permissions. The button appears on the Accounts page.
OCI provider shows "Not Installed"The OCI mod needs to be installed in your workspace. Contact your Guardrails administrator.
Connectivity test fails with authentication errorVerify your Tenancy OCID, User OCID, Fingerprint, and Private Key are correct. Ensure the API key has been uploaded to the user in OCI.
Connectivity test fails with authorization errorThe API user lacks IAM policies. Add at minimum allow group <group> to inspect all-resources in tenancy.
Private Key rejectedEnsure you're pasting the private key (not the public key). The key must include the -----BEGIN PRIVATE KEY----- header. RSA keys with -----BEGIN RSA PRIVATE KEY----- are also supported.
Wrong Home RegionThe Home Region must match your tenancy's home region. IAM operations are only available in the home region. Find it under Administration > Tenancy Details in the OCI Console.
Controls in ERROR stateControls may enter error state if the required IAM policies are not granted. Learn more about control states.
Further assistanceOpen a Support Ticket