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
- Access to the Turbot Guardrails console with
Turbot/AdminorTurbot/Ownerpermissions. - The
ocimod installed in your workspace. - An OCI API signing key pair generated for a user in your tenancy. See OCI documentation: Required Keys and OCIDs.
- The following values from your OCI tenancy:
| Value | Where to Find It |
|---|---|
| Tenancy OCID | OCI Console > Profile > Tenancy > copy the OCID |
| User OCID | OCI Console > Identity > Users > select the API user > copy the OCID |
| API Key Fingerprint | Displayed when you upload the public key to the user's API Keys |
| Private Key | The PEM-encoded private key from your API signing key pair |
| Home Region | OCI 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 tenancyandread all-resources in tenancy. For full governance capabilities including tagging and remediation, grantmanage 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.

[!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.

| Field | Description |
|---|---|
| Tenancy OCID | The OCID of your OCI tenancy (e.g., ocid1.tenancy.oc1..aaaaaaaax7fk3...). |
| User OCID | The OCID of the OCI user with API key credentials (e.g., ocid1.user.oc1..aaaaaaaab9exa...). |
| API Key Fingerprint | The fingerprint of the API signing key uploaded to the user (e.g., a1:b2:c3:d4:e5:f6:...). |
| Private Key | The PEM-encoded private key for API signing. Paste the full key including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- markers. |
| Home Region | Select 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.

[!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.

Click Continue to proceed.
[!TIP] If the connectivity test fails, verify that:
- The Tenancy OCID and User OCID are correct.
- The API Key Fingerprint matches the public key uploaded to the user in OCI.
- The Private Key is the matching private key (not the public key).
- The Home Region matches your tenancy's home region.
- The user has not been deactivated in OCI.
Step 5: Choose Destination Folder
Choose where to place this connection in your Guardrails resource hierarchy.

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:
- OCI Credentials: Tenancy OCID, User OCID, Fingerprint, and Home Region
- Tenancy: Tenancy Name and verification status
- Destination Folder: Where the connection will be placed

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.

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:
| Resource | Description |
|---|---|
| Compartments | All compartments in the tenancy hierarchy, including nested compartments. |
| Regions | All subscribed regions within the tenancy. |
| Resources | Resources 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
| Issue | Solution |
|---|---|
| Create Connection not available | Ensure 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 error | Verify 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 error | The API user lacks IAM policies. Add at minimum allow group <group> to inspect all-resources in tenancy. |
| Private Key rejected | Ensure 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 Region | The 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 state | Controls may enter error state if the required IAM policies are not granted. Learn more about control states. |
| Further assistance | Open a Support Ticket |