Is Infrastructure as Code supported?
Infrastructure as Code (IaC) is not just supported on OCI; it is the recommended way to manage the platform. Oracle has positioned itself as one of the most "automation-friendly" clouds by offering both deep support for industry-standard open-source tools and its own managed IaC service.
Here is how you can manage your OCI "rented" infrastructure through code:
Oracle has been a primary contributor to the OCI Terraform Provider, which remains the most popular way to automate OCI.
Terraform: OCI fully supports HashiCorp Terraform. You can use standard HCL (HashiCorp Configuration Language) to define everything from VCNs to Autonomous Databases.
OpenTofu Support: As of 2026, OCI is fully compatible with OpenTofu (the open-source fork of Terraform). This gives you the freedom to choose your preferred engine without changing your code.
State Management: You can store your "state files" securely in OCI Object Storage using standard backend configurations.
If you don't want to manage your own Terraform binary or state files, OCI provides Resource Manager—a fully managed "Terraform-as-a-Service."
No Install Required: You run your Terraform plans and applies directly in the OCI Console.
Drift Detection: It can automatically scan your real-world resources and alert you if someone made manual changes (the "click-ops" trap) that differ from your code.
In-Console Editor: Includes a built-in code editor (Cloud Shell-based) so you can tweak your .tf files and deploy them without leaving your browser.
Cost: Resource Manager is a free service; you only pay for the underlying resources (VMs, storage) that you provision.
For teams that prefer using actual programming languages instead of markup languages like YAML or HCL, Pulumi is heavily supported on OCI in 2026.
Languages: Define your OCI infrastructure using Python, TypeScript, Go, or Java.
Power: This allows you to use standard software engineering practices—like loops, classes, and unit tests—directly within your infrastructure definitions.
While Terraform is great for building the server, Ansible is the go-to for configuring it (installing software, patching, etc.).
OCI Ansible Collection: Oracle maintains a dedicated collection of modules that allow you to manage OCI resources directly from an Ansible Playbook.
Dynamic Inventory: Ansible can "query" your OCI tenancy to automatically find all servers with a specific tag (e.g., Environment: Production) and apply updates to them simultaneously.
| Tool | Language | Best For... | OCI Hosting |
| Terraform | HCL | Most "cloud-agnostic" teams | Resource Manager |
| OpenTofu | HCL | Open-source purists | Self-managed |
| Pulumi | Python/TS/Go | Developers who hate YAML/HCL | Self-managed |
| Ansible | YAML | OS-level configuration & Patching | Self-managed |
If you are new to IaC, OCI provides a library of Sample Templates within Resource Manager. With a few clicks, you can deploy a "Production-Ready VCN" or a "Load Balanced Web Server" using pre-written, Oracle-verified Terraform code.