/oraclecloud-pack:oraclecloud-ci-integrationfrom oraclecloud-pack
Configures CI/CD pipelines for Oracle Cloud Infrastructure using Terraform and GitHub Actions. Includes OCI authentication setup, Terraform plan execution, and workarounds for known OCI provider bugs.
Ships in oraclecloud-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Set up GitHub Actions workflows that authenticate to OCI, run Terraform plans, and execute tests against OCI services. The OCI Terraform provider has known bugs — notably ResourcePrincipal forcing the wrong region (#1761) — that require specific workarounds. This skill provides battle-tested CI patterns that avoid those pitfalls.
Purpose: Get a working CI pipeline that authenticates to OCI, runs Terraform safely, and tests OCI-dependent code without flaky failures.
~/.oci/configoracle/oci)OCI_USER_OCID, OCI_FINGERPRINT, OCI_TENANCY_OCID, OCI_REGION, OCI_PRIVATE_KEY (PEM contents, base64-encoded)pip install oci for SDK-based testsOCI API key authentication requires five values. Store them as GitHub repository secrets:
# Encode your private key for safe storage in GitHub Secrets
base64 -w 0 ~/.oci/oci_api_key.pem
# Copy output → GitHub Settings > Secrets > OCI_PRIVATE_KEY
The remaining secrets come from your ~/.oci/config file: user, fingerprint, tenancy, and region.
Create .github/workflows/oci-terraform.yml:
name: OCI Terraform
on:
push:
branches: [main]
pull_request:
env:
TF_VAR_tenancy_ocid: ${{ secrets.OCI_TENANCY_OCID }}
TF_VAR_user_ocid: ${{ secrets.OCI_USER_OCID }}
TF_VAR_fingerprint: ${{ secrets.OCI_FINGERPRINT }}
TF_VAR_region: ${{ secrets.OCI_REGION }}
jobs:
plan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Write OCI private key
run: |
echo "${{ secrets.OCI_PRIVATE_KEY }}" | base64 -d > /tmp/oci_key.pem
chmod 600 /tmp/oci_key.pem
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.7.0"
- name: Terraform Init
run: terraform init
- name: Terraform Plan
run: terraform plan -out=tfplan
env:
TF_VAR_private_key_path: /tmp/oci_key.pem
Configure the OCI provider with explicit region to avoid the ResourcePrincipal region bug (#1761):
terraform {
required_providers {
oci = {
source = "oracle/oci"
version = ">= 5.0.0"
}
}
}
provider "oci" {
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
# CRITICAL: Always set region explicitly.
# ResourcePrincipal auth can force the wrong region (#1761).
region = var.region
}
variable "tenancy_ocid" {}
variable "user_ocid" {}
variable "fingerprint" {}
variable "private_key_path" {}
variable "region" { default = "us-ashburn-1" }
For non-Terraform CI tasks, use the OCI CLI directly:
- name: Install OCI CLI
run: |
pip install oci-cli
mkdir -p ~/.oci
echo "${{ secrets.OCI_PRIVATE_KEY }}" | base64 -d > ~/.oci/oci_api_key.pem
chmod 600 ~/.oci/oci_api_key.pem
cat > ~/.oci/config << EOF
[DEFAULT]
user=${{ secrets.OCI_USER_OCID }}
fingerprint=${{ secrets.OCI_FINGERPRINT }}
tenancy=${{ secrets.OCI_TENANCY_OCID }}
region=${{ secrets.OCI_REGION }}
key_file=~/.oci/oci_api_key.pem
EOF
- name: List compute instances
run: oci compute instance list --compartment-id ${{ secrets.OCI_TENANCY_OCID }}
Write testable OCI code by mocking the SDK clients:
import oci
from unittest.mock import MagicMock, patch
def list_instances(compartment_id: str) -> list:
"""List all compute instances in a compartment."""
config = oci.config.from_file("~/.oci/config")
client = oci.core.ComputeClient(config)
response = client.list_instances(compartment_id=compartment_id)
return response.data
@patch("oci.core.ComputeClient")
@patch("oci.config.from_file")
def test_list_instances(mock_config, mock_client_cls):
mock_client = MagicMock()
mock_client_cls.return_value = mock_client
mock_client.list_instances.return_value.data = [
MagicMock(display_name="web-server-1", lifecycle_state="RUNNING")
]
instances = list_instances("ocid1.compartment.oc1..example")
assert len(instances) == 1
assert instances[0].display_name == "web-server-1"
Successful completion produces:
| Error | Code | Cause | Solution |
|---|---|---|---|
| NotAuthenticated | 401 | Bad API key or wrong fingerprint | Verify secrets match ~/.oci/config values exactly |
| NotAuthorizedOrNotFound | 404 | IAM policy missing or wrong OCID | Add required IAM policy for the API key user |
| Provider crash on plan | N/A | ResourcePrincipal region bug (#1761) | Always set region explicitly in provider block |
| TooManyRequests | 429 | Rate limited (no Retry-After header) | Add retry logic with exponential backoff |
| CERTIFICATE_VERIFY_FAILED | N/A | SSL cert issue in CI runner | Run pip install certifi and set REQUESTS_CA_BUNDLE |
| Terraform init fails | N/A | Provider version mismatch | Pin provider version: version = ">= 5.0.0" |
Quick OCI auth test in CI:
# Verify OCI credentials work in a GitHub Actions step
pip install oci
python3 -c "
import oci
config = oci.config.from_file('~/.oci/config')
identity = oci.identity.IdentityClient(config)
user = identity.get_user(config['user']).data
print(f'Authenticated as: {user.name}')
"
Terraform plan with JSON output for PR comments:
terraform plan -out=tfplan
terraform show -json tfplan | python3 -c "
import sys, json
plan = json.load(sys.stdin)
changes = plan.get('resource_changes', [])
adds = sum(1 for c in changes if 'create' in c['change']['actions'])
dels = sum(1 for c in changes if 'delete' in c['change']['actions'])
print(f'Plan: +{adds} -{dels} resources')
"
After CI is working, proceed to oraclecloud-deploy-integration to set up container deployments via OKE or Container Instances, or see oraclecloud-observability to add monitoring to your CI-deployed infrastructure.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
oracle-cloud, oci, terraform, github-actions, ci-cd, infrastructure-automation
26 skills in this plugin
/oraclecloud-common-errorsDiagnose and fix Oracle Cloud Infrastructure API errors with real error codes and proven fixes.
Use when encountering OCI ServiceError exceptions, auth failures, SSL issues, or timeout errors.
Trigger with "oci error", "fix oraclecloud", "debug oci", "NotAuthorizedOrNotFound", "oci 401".
/oraclecloud-core-workflow-aLaunch, manage, and scale OCI compute instances with capacity retry logic.
Use when provisioning VMs, selecting instance shapes, or handling "out of capacity" errors.
Trigger with "oci compute", "launch instance", "out of capacity", "instance shapes".
/oraclecloud-core-workflow-bBuild OCI networking from scratch — VCN, subnets, gateways, and security rules.
Use when creating a new VCN, debugging connectivity issues, or setting up security lists and NSGs.
Trigger with "oci networking", "vcn setup", "security list", "nsg rules", "oci subnet".
/oraclecloud-cost-tuningTrack OCI spend with the Usage API and set up budget alerts.
Use when monitoring Oracle Cloud costs, creating budgets, analyzing spend by compartment or service, or optimizing Universal Credits consumption.
Trigger with "oraclecloud cost", "oci budget", "oci usage api", "oci spending", "oracle cloud cost tuning".
/oraclecloud-data-handlingManage OCI Object Storage — buckets, uploads, PARs, and lifecycle policies.
Use when uploading objects, creating pre-authenticated requests, or configuring lifecycle rules.
Trigger with "oci object storage", "oci bucket", "par url", "multipart upload", "oci lifecycle".
/oraclecloud-debug-bundleCollect OCI instance diagnostics — serial console, cloud-init logs, metadata, and VCN flow logs — into a single debug bundle.
Use when an OCI instance is unresponsive, stuck in provisioning, or showing infrastructure errors.
Trigger with "oraclecloud debug bundle", "oci diagnostics", "oci serial console", "oci instance debug".
npx claudepluginhub flight505/skill-forge --plugin oraclecloud-packOther plugins' skills for the same job