Decommission a Tenancy
Decommissioning an OCI tenancy is a two-phase process:
- Disable Guardrails-managed infrastructure: stop event polling and disable any active controls.
- Disconnect the tenancy from the Guardrails workspace, removing all CMDB records and policy settings.
Prerequisites
Turbot/Ownerpermissions at the Turbot resource level.
Phase 1: Disable Event Polling and Controls
Create the following policy settings on the target tenancy to clean up Guardrails-managed resources. Allow time for Guardrails to complete each change before proceeding to Phase 2.
| # | Policy | Value | What It Does |
|---|---|---|---|
| 1 | OCI > Turbot > Event Poller | Disabled | Stops polling the OCI Audit Log for events. |
[!TIP] Unlike AWS or Azure, OCI does not deploy any infrastructure in your cloud environment (no event handlers, IAM roles, or logging buckets). Decommissioning is simpler because you only need to disable the event poller and remove the credential policies before disconnecting.
Phase 2: Disconnect the Tenancy
Once the event poller is disabled and controls have settled:
-
Navigate to the tenancy in the Guardrails console.
-
Select the Settings tab to view the connection credentials and information.

-
Click Delete Connection in the top right corner of the page.
-
In the confirmation dialog, confirm the deletion.
Guardrails removes the tenancy, all child compartments, resources, controls, and policy settings. The time to complete depends on the number of resources. Larger tenancies take longer.
[!NOTE] Disconnecting a tenancy does not modify anything in your OCI environment. It only removes the records from Guardrails. Your OCI resources, compartments, IAM policies, and API keys remain unchanged.
Post-Disconnection Cleanup
After disconnecting the tenancy from Guardrails, you may optionally clean up the OCI side:
- Remove the API key from the service user in OCI Console (Identity > Users > select user > API Keys > delete the key).
- Remove the IAM policy granting permissions to the Guardrails group.
- Remove the service user if it was created solely for Guardrails.
Troubleshooting
The disconnection may time out if the tenancy has a large number of resources.
Manual Resource Count Reduction
- Navigate to the tenancy's Resources tab to identify the largest resource types.
- For each large resource type, set its CMDB policy to
Skip(e.g.,OCI > Compute > Instance > CMDBset toSkip). This purges those CMDB entries. - Wait for the purge to complete, then retry the disconnection.
- Repeat until successful.
How Disconnection Works
Guardrails removes the tenancy, all child resources, controls, and policy settings in a single SQL transaction. If the transaction exceeds the statement timeout (due to a large resource count), it rolls back safely and the tenancy remains visible. Reduce the resource count and retry.
If the tenancy cannot be disconnected after multiple attempts, Open a Support Ticket.