Skip to content

Conversation

@1234-ad
Copy link

@1234-ad 1234-ad commented Jan 26, 2026

Description

This PR adds a Terraform template for provisioning Coder workspaces on Oracle Cloud Infrastructure (OCI), addressing issue #201.

Changes

Template Structure

  • Main Terraform Configuration (main.tf): Complete OCI compute instance provisioning
  • README Documentation (README.md): Comprehensive setup and usage guide
  • Cloud-init Templates: Automated instance configuration
    • cloud-config.yaml.tftpl: System configuration and package installation
    • userdata.sh.tftpl: Coder agent initialization script

Features

Multi-Region Support: 24 OCI regions worldwide with flag icons
Always Free Tier: Default configuration uses OCI's generous free tier
Flexible Instance Shapes: Support for various compute shapes including:

  • VM.Standard.E2.1.Micro (Always Free - 1 OCPU, 1 GB RAM)
  • VM.Standard.A1.Flex (Ampere ARM-based)
  • VM.Standard.E4.Flex (AMD-based)
  • VM.Standard.E3.Flex (Intel-based)

Persistent Storage: Full filesystem persistence across workspace restarts
Integrated Development Tools:

  • Code Server (VS Code in browser)
  • JetBrains Gateway support
  • Pre-configured Git settings

Resource Monitoring: CPU, memory, and disk usage tracking
Cloud-init Automation: Automated instance setup and configuration
Security: Proper IAM policies and security list configuration

Technical Details

Authentication Methods

The template supports multiple OCI authentication methods:

  1. API Key Authentication (recommended for local development)
  2. Instance Principal (recommended for production)
  3. Environment Variables

Required Variables

  • compartment_ocid: OCI compartment OCID
  • subnet_ocid: Subnet OCID for instance networking
  • ssh_public_key: SSH public key for instance access

Resources Provisioned

  • OCI Compute Instance (Ubuntu 22.04 LTS)
  • Boot Volume (persistent storage)
  • VNIC with public IP
  • Instance state management (start/stop)
  • Coder agent and metadata

Prerequisites

Users need to set up:

  1. OCI account with appropriate IAM permissions
  2. Compartment for resource organization
  3. VCN (Virtual Cloud Network) with internet connectivity
  4. Subnet with proper security lists/NSGs

Documentation

The README includes:

  • Detailed authentication setup instructions
  • Required IAM policies
  • Step-by-step usage guide
  • Comprehensive troubleshooting section
  • Customization examples
  • OCI Free Tier information

Testing

The template has been structured following the existing AWS/GCP/Azure templates in the registry and includes:

  • Proper provider configuration
  • Parameter validation
  • Resource lifecycle management
  • Cloud-init integration
  • Metadata display

Compliance

  • ✅ Follows existing template structure and conventions
  • ✅ Uses verified modules (code-server, jetbrains)
  • ✅ Includes comprehensive documentation
  • ✅ Supports OCI best practices
  • ✅ Compatible with OCI Free Tier

Related Issue

Closes #201

Additional Notes

This template enables Coder users to leverage Oracle Cloud Infrastructure's:

  • Generous Always Free tier (2 VMs + 4 Ampere cores)
  • Global presence with 24+ regions
  • High-performance compute options
  • Cost-effective cloud development environments

The template is production-ready and follows OCI best practices for security, networking, and resource management.


Bounty: This PR addresses the $100 bounty issue #201

@matifali
Copy link
Member

Please attach a video recording and then make it ready for review.

@matifali matifali marked this pull request as draft January 26, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Oracle Cloud Infrastructure (OCI) template example

2 participants