<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sys-ronin</title>
    <description>The latest articles on DEV Community by sys-ronin (@sys-ronin).</description>
    <link>https://dev.to/sys-ronin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3976523%2F60e91662-5731-4957-b374-9d4841750a7d.png</url>
      <title>DEV Community: sys-ronin</title>
      <link>https://dev.to/sys-ronin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sys-ronin"/>
    <language>en</language>
    <item>
      <title>AdventureWorks SQL Server with Docker and DBeaver Keystore Helper</title>
      <dc:creator>sys-ronin</dc:creator>
      <pubDate>Wed, 12 Aug 2026 20:36:41 +0000</pubDate>
      <link>https://dev.to/sys-ronin/adventureworks-sql-server-with-dbeaver-keystore-helper-3e8f</link>
      <guid>https://dev.to/sys-ronin/adventureworks-sql-server-with-dbeaver-keystore-helper-3e8f</guid>
      <description>&lt;p&gt;I needed a local SQL Server with the AdventureWorks2022 sample database. Sounds like a 10-minute job, right? Run a container, restore a &lt;code&gt;.bak&lt;/code&gt;, connect with DBeaver. Done.&lt;/p&gt;

&lt;p&gt;It took two hours. Here's what actually happened, what broke, and the setup that finally worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Goal
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SQL Server 2022 running in Docker on Debian&lt;/li&gt;
&lt;li&gt;Auto-restore &lt;code&gt;AdventureWorks2022.bak&lt;/code&gt; on first boot&lt;/li&gt;
&lt;li&gt;Connect from DBeaver without certificate errors&lt;/li&gt;
&lt;li&gt;Survive restarts without re-restoring the database&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;A Docker Compose setup with a custom &lt;code&gt;entrypoint.sh&lt;/code&gt; that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Starts SQL Server in the background&lt;/li&gt;
&lt;li&gt;Polls &lt;code&gt;sqlcmd&lt;/code&gt; every 2 seconds until the engine is ready&lt;/li&gt;
&lt;li&gt;Checks if &lt;code&gt;AdventureWorks2022&lt;/code&gt; already exists (idempotent)&lt;/li&gt;
&lt;li&gt;If not, runs &lt;code&gt;RESTORE DATABASE ... WITH MOVE&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Keeps the container alive&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The database files live in a named Docker volume, so stopping and restarting the container doesn't wipe your data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bugs That Weren't in the Tutorial
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Permission denied on entrypoint.sh
&lt;/h3&gt;

&lt;p&gt;I store my projects on Koofr (cloud-synced). &lt;code&gt;chmod +x&lt;/code&gt; works on the host, but Docker bind-mounts the file without the execute bit. The container kept restarting with &lt;code&gt;Permission denied&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Run the script through &lt;code&gt;/bin/bash&lt;/code&gt; instead of relying on the shebang:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;entrypoint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/bin/bash"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/usr/config/entrypoint.sh"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. "Access is denied" on master.mdf
&lt;/h3&gt;

&lt;p&gt;SQL Server's default &lt;code&gt;mssql&lt;/code&gt; user couldn't write to the Docker volume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Added &lt;code&gt;user: root&lt;/code&gt; to the compose service. Fine for local dev. Don't do this in production.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. sqlcmd v18 won't connect without -C
&lt;/h3&gt;

&lt;p&gt;SQL Server 2022 bundles &lt;code&gt;sqlcmd&lt;/code&gt; in &lt;code&gt;/opt/mssql-tools18/bin/&lt;/code&gt;. This version refuses to connect to localhost without explicitly trusting the self-signed certificate, even though it's the same machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Every &lt;code&gt;sqlcmd&lt;/code&gt; call gets the &lt;code&gt;-C&lt;/code&gt; flag. The healthcheck too.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. DBeaver's JDBC driver demanded a keystore
&lt;/h3&gt;

&lt;p&gt;I kept getting:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;"keyStoreAuthentication" connection string keyword must be specified, if "keyStoreSecret" is specified&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clearing the properties in one connection didn't help — the driver had cached defaults somewhere. I spent 20 minutes in DBeaver preferences before giving up and creating a dummy Java keystore.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; One &lt;code&gt;keytool&lt;/code&gt; command to generate a fake &lt;code&gt;.jks&lt;/code&gt; file, then four driver properties in DBeaver:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keyStoreAuthentication&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;JavaKeyStorePassword&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keyStoreLocation&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/absolute/path/to/dummy.jks&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keyStoreSecret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dummy123&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;trustServerCertificate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;It shouldn't be this hard to connect to a local database. But here we are.&lt;/p&gt;

&lt;h2&gt;
  
  
  DBeaver Connection — The Exact Settings
&lt;/h2&gt;

&lt;p&gt;After the container is running, here's how to connect DBeaver without any certificate drama.&lt;/p&gt;

&lt;h3&gt;
  
  
  Main Tab
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Host&lt;/td&gt;
&lt;td&gt;&lt;code&gt;localhost&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Port&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;1433&lt;/code&gt; (or whatever you set in &lt;code&gt;.env&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AdventureWorks2022&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;SQL Server Authentication&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sa&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password&lt;/td&gt;
&lt;td&gt;your &lt;code&gt;.env&lt;/code&gt; password&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Driver Properties Tab
&lt;/h3&gt;

&lt;p&gt;These are the properties that actually matter. Add or edit them here:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;trustServerCertificate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tells the JDBC driver to accept the self-signed cert SQL Server generates on first boot. Without this, you get SSL handshake failures even on localhost.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keyStoreAuthentication&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;JavaKeyStorePassword&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tells the driver you're using a local JKS file, not Azure Key Vault.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keyStoreLocation&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/absolute/path/to/dummy.jks&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Points to the dummy keystore file. Use the absolute path — DBeaver doesn't resolve &lt;code&gt;~&lt;/code&gt; here.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keyStoreSecret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dummy123&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The password for the dummy keystore.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;How to get there:&lt;/strong&gt; Edit Connection → Driver Properties → scroll down or use the search box. If a property doesn't exist, right-click in the list and choose &lt;strong&gt;Add New Property&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Test Connection&lt;/strong&gt;. It should say "Connected".&lt;/p&gt;

&lt;h3&gt;
  
  
  If You Don't Want the Keystore Hack
&lt;/h3&gt;

&lt;p&gt;You can try resetting the driver completely:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Window → Preferences → Connections → Drivers → Microsoft JDBC Driver for SQL Server&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Reset to Defaults&lt;/strong&gt; (or delete and re-download)&lt;/li&gt;
&lt;li&gt;In your connection: Driver Properties → gear icon → &lt;strong&gt;Reset to Defaults&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Add back only: &lt;code&gt;trustServerCertificate = true&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sometimes this works. Sometimes the keystore properties come back anyway. The dummy keystore is faster and more reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Repo
&lt;/h2&gt;

&lt;p&gt;Everything is here: &lt;code&gt;docker-compose.yml&lt;/code&gt;, &lt;code&gt;entrypoint.sh&lt;/code&gt;, the keystore generator, and a full setup guide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/sjyotis/adventureworks2022-docker" rel="noopener noreferrer"&gt;github.com/sjyotis/adventureworks2022-docker&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/sjyotis/adventureworks2022-docker.git
&lt;span class="nb"&gt;cd &lt;/span&gt;adventureworks2022-docker
&lt;span class="nb"&gt;mv&lt;/span&gt; /path/to/AdventureWorks2022.bak backups/
docker compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait for the logs to show &lt;code&gt;Restore completed successfully!&lt;/code&gt;, then connect DBeaver using the settings above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repo Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;adventureworks2022-docker/
├── docker-compose.yml              # Main SQL Server container
├── .env                            # Password and port config
├── init/
│   └── entrypoint.sh              # Auto-restore on first boot
├── backups/
│   └── AdventureWorks2022.bak    # Drop your .bak here
├── dbeaver-keystore-fix.md        # Full keystore workaround guide
├── adventureworks-docker-setup.md # Complete implementation docs
└── keystore-generator/
    ├── docker-compose.yml         # One-shot keystore generator
    └── generate_keystore.py       # Python wrapper if you prefer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What This Actually Demonstrates
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Docker Compose orchestration with health checks and named volumes&lt;/li&gt;
&lt;li&gt;Bash scripting for service initialization and idempotency&lt;/li&gt;
&lt;li&gt;SQL Server administration (&lt;code&gt;RESTORE FILELISTONLY&lt;/code&gt;, &lt;code&gt;WITH MOVE&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;SSL/TLS debugging in client drivers&lt;/li&gt;
&lt;li&gt;Cross-platform filesystem edge cases (cloud-synced storage stripping permissions)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's not just "I ran a database in Docker." It's a complete local dev infrastructure setup that handles provisioning, initialization, persistence, and client connectivity across the full stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Files
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker-compose.yml&lt;/code&gt; — SQL Server 2022 container with volume mounts and healthcheck&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;init/entrypoint.sh&lt;/code&gt; — Auto-restore script with startup polling&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.env&lt;/code&gt; — Configurable SA password and port&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;backups/&lt;/code&gt; — Drop your &lt;code&gt;.bak&lt;/code&gt; here&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dbeaver-keystore-fix.md&lt;/code&gt; — Standalone guide for the DBeaver certificate workaround&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you've ever fought with DBeaver certificates, SQL Server Docker permissions, or restore scripts that assume the database is already running, this repo is for you.&lt;/p&gt;

&lt;p&gt;Pull requests welcome. Issues too — especially if you hit a new edge case I haven't seen yet.&lt;/p&gt;

</description>
      <category>sqlserver</category>
      <category>dbeaver</category>
      <category>adventureworks</category>
      <category>devops</category>
    </item>
    <item>
      <title>[How to] Terraform Offline Provider Setup: Zero Downloads &amp; Clean Repos with Local Mirrors (with script)</title>
      <dc:creator>sys-ronin</dc:creator>
      <pubDate>Fri, 07 Aug 2026 19:47:04 +0000</pubDate>
      <link>https://dev.to/sys-ronin/terraform-offline-provider-setup-zero-downloads-clean-repos-with-local-mirrors-464o</link>
      <guid>https://dev.to/sys-ronin/terraform-offline-provider-setup-zero-downloads-clean-repos-with-local-mirrors-464o</guid>
      <description>&lt;h1&gt;
  
  
  Terraform Offline Provider Setup Guide
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Using &lt;code&gt;.terraformrc&lt;/code&gt; + &lt;code&gt;.terraform.d&lt;/code&gt; for Zero-Download, Repo-Clean Infrastructure
&lt;/h2&gt;




&lt;h2&gt;
  
  
  1. The Problem
&lt;/h2&gt;

&lt;p&gt;By default, Terraform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downloads providers from the internet on every &lt;code&gt;terraform init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Creates a &lt;code&gt;.terraform/&lt;/code&gt; directory inside every project folder&lt;/li&gt;
&lt;li&gt;Bloats repositories with cached plugins and lock files&lt;/li&gt;
&lt;li&gt;Breaks in air-gapped or CI/CD environments without internet access&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; Your repo is dirty, initialization is slow, and builds are non-deterministic.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Solution
&lt;/h2&gt;

&lt;p&gt;Use Terraform's &lt;strong&gt;CLI Configuration File&lt;/strong&gt; (&lt;code&gt;.terraformrc&lt;/code&gt;) to define a &lt;strong&gt;filesystem mirror&lt;/strong&gt;. This tells Terraform to resolve providers from a local directory instead of the public registry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero internet calls&lt;/strong&gt; for known providers after initial setup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No &lt;code&gt;.terraform/&lt;/code&gt; directories&lt;/strong&gt; inside project folders (only a tiny lock file)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant &lt;code&gt;terraform init&lt;/code&gt;&lt;/strong&gt; across all projects using the same provider version&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic builds&lt;/strong&gt; — every teammate uses the exact same binary&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Air-gapped / CI-ready&lt;/strong&gt; — works without internet once configured&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Directory Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.terraform.d/
├── checkpoint_cache              # Terraform version check cache
├── checkpoint_signature
└── plugins-local/                # &amp;lt;-- Your local provider mirror
    └── registry.terraform.io/
        └── oracle/
            └── oci/
                ├── index.json
                ├── 6.20.0/
                │   └── linux_amd64/
                │       └── terraform-provider-oci_v6.20.0_x5   &amp;lt;-- extracted binary
                └── 5.47.0/
                    └── linux_amd64/
                        └── terraform-provider-oci_v5.47.0_x5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Important Naming Rules
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Element&lt;/th&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Directory path&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Must follow &lt;code&gt;registry.terraform.io/&amp;lt;namespace&amp;gt;/&amp;lt;name&amp;gt;/&amp;lt;version&amp;gt;/&amp;lt;arch&amp;gt;/&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Binary name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Must be &lt;code&gt;terraform-provider-&amp;lt;name&amp;gt;_v&amp;lt;version&amp;gt;_x5&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;No &lt;code&gt;.zip&lt;/code&gt; files&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Extract the binary; &lt;code&gt;.zip&lt;/code&gt; files are ignored by &lt;code&gt;filesystem_mirror&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;&lt;code&gt;index.json&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Optional — Terraform can work without it for simple mirrors&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  4. Step-by-Step Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Create &lt;code&gt;~/.terraformrc&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This is the Terraform CLI configuration file. It lives in your &lt;strong&gt;home directory&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;provider_installation&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;# Use local filesystem for oracle/oci provider&lt;/span&gt;
  &lt;span class="nx"&gt;filesystem_mirror&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;path&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/home/unknown/.terraform.d/plugins-local"&lt;/span&gt;
    &lt;span class="nx"&gt;include&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;# Everything else falls back to internet&lt;/span&gt;
  &lt;span class="nx"&gt;direct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;exclude&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Critical details:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File must be named exactly &lt;code&gt;.terraformrc&lt;/code&gt; (not &lt;code&gt;terraform.rc&lt;/code&gt;, not &lt;code&gt;.terraformrc.txt&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Must reside in &lt;code&gt;$HOME/.terraformrc&lt;/code&gt; (Linux/macOS) or &lt;code&gt;%USERPROFILE%\terraform.rc&lt;/code&gt; (Windows)&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;include&lt;/code&gt; pattern uses the &lt;strong&gt;full source address&lt;/strong&gt;: &lt;code&gt;registry.terraform.io/oracle/oci&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Do &lt;strong&gt;not&lt;/strong&gt; add &lt;code&gt;/*&lt;/code&gt; at the end — &lt;code&gt;oracle/oci&lt;/code&gt; is the correct pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: Prepare the Mirror Directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.terraform.d/plugins-local/registry.terraform.io/oracle/oci/6.20.0/linux_amd64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Extract the Provider Binary
&lt;/h3&gt;

&lt;p&gt;If you downloaded the provider as a &lt;code&gt;.zip&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/.terraform.d/plugins-local/registry.terraform.io/oracle/oci/6.20.0/linux_amd64
unzip terraform-provider-oci_6.20.0_linux_amd64.zip
&lt;span class="nb"&gt;mv &lt;/span&gt;terraform-provider-oci_v6.20.0 terraform-provider-oci_v6.20.0_x5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Verify:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; ~/.terraform.d/plugins-local/registry.terraform.io/oracle/oci/6.20.0/linux_amd64/
&lt;span class="c"&gt;# Should show: terraform-provider-oci_v6.20.0_x5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Configure &lt;code&gt;provider.tf&lt;/code&gt; in Your Project
&lt;/h3&gt;

&lt;p&gt;In &lt;strong&gt;every&lt;/strong&gt; Terraform stack that uses this provider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;required_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;gt;= 1.5.0"&lt;/span&gt;
  &lt;span class="nx"&gt;required_providers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;oci&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;source&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;
      &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"6.20.0"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"oci"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;
  &lt;span class="nx"&gt;user_ocid&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user_ocid&lt;/span&gt;
  &lt;span class="nx"&gt;fingerprint&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fingerprint&lt;/span&gt;
  &lt;span class="nx"&gt;private_key_path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;private_key_path&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;region&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What happens:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terraform reads &lt;code&gt;source = "oracle/oci"&lt;/code&gt; and &lt;code&gt;version = "6.20.0"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It checks &lt;code&gt;.terraformrc&lt;/code&gt; and finds a &lt;code&gt;filesystem_mirror&lt;/code&gt; matching that address&lt;/li&gt;
&lt;li&gt;It copies the binary from &lt;code&gt;~/.terraform.d/plugins-local/...&lt;/code&gt; into memory&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No &lt;code&gt;.terraform/providers/&lt;/code&gt; directory is created in your project folder&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;State backends still work normally (S3, HTTP, local, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 5: Initialize and Verify
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/oci-infra/shared
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; .terraform/ .terraform.lock.hcl   &lt;span class="c"&gt;# clean slate&lt;/span&gt;
terraform init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Initializing provider plugins...
- Finding oracle/oci versions matching "6.20.0"...
- Installing oracle/oci v6.20.0...
- Installed oracle/oci v6.20.0 (unauthenticated)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key phrase is &lt;strong&gt;&lt;code&gt;(unauthenticated)&lt;/code&gt;&lt;/strong&gt;. If you see &lt;code&gt;(signed by a HashiCorp partner...)&lt;/code&gt;, Terraform downloaded from the internet instead of your mirror.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Space Savings Breakdown
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Before (Default Behavior)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;oci-infra/
├── shared/
│   ├── .terraform/                 # ~180 MB
│   │   └── providers/
│   │       └── registry.terraform.io/
│   │           └── oracle/oci/6.20.0/...
│   └── .terraform.lock.hcl
├── vm-amd/
│   ├── .terraform/                 # ~180 MB (duplicate!)
│   └── .terraform.lock.hcl
└── vm-arm/
    ├── .terraform/                 # ~180 MB (duplicate!)
    └── .terraform.lock.hcl

Total: ~540 MB in project folders
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  After (Local Mirror)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.terraform.d/
└── plugins-local/
    └── oracle/oci/6.20.0/...       # ~180 MB (stored once)

oci-infra/
├── shared/
│   └── .terraform.lock.hcl         # ~2 KB
├── vm-amd/
│   └── .terraform.lock.hcl         # ~2 KB
└── vm-arm/
    └── .terraform.lock.hcl         # ~2 KB

Total: ~180 MB (one copy) + ~6 KB lock files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Savings:&lt;/strong&gt; ~360 MB eliminated. With 10 projects and 3 provider versions, the savings scale to &lt;strong&gt;multiple gigabytes&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. CI/CD &amp;amp; Team Benefits
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Without Mirror&lt;/th&gt;
&lt;th&gt;With Mirror&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;terraform init&lt;/code&gt; in CI&lt;/td&gt;
&lt;td&gt;30-60s download&lt;/td&gt;
&lt;td&gt;1-2s copy from cache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Air-gapped runner&lt;/td&gt;
&lt;td&gt;Fails&lt;/td&gt;
&lt;td&gt;Works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reproducibility&lt;/td&gt;
&lt;td&gt;Depends on registry uptime&lt;/td&gt;
&lt;td&gt;100% offline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repo size&lt;/td&gt;
&lt;td&gt;Bloated with &lt;code&gt;.terraform/&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Clean, only &lt;code&gt;.tf&lt;/code&gt; files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parallel jobs&lt;/td&gt;
&lt;td&gt;Each downloads separately&lt;/td&gt;
&lt;td&gt;Shared system cache&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  7. Adding More Providers
&lt;/h2&gt;

&lt;p&gt;To add another provider (e.g., &lt;code&gt;hashicorp/random&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.terraform.d/plugins-local/registry.terraform.io/hashicorp/random/3.6.0/linux_amd64
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/.terraform.d/plugins-local/registry.terraform.io/hashicorp/random/3.6.0/linux_amd64
&lt;span class="c"&gt;# Extract binary and rename:&lt;/span&gt;
&lt;span class="nb"&gt;mv &lt;/span&gt;terraform-provider-random_v3.6.0 terraform-provider-random_v3.6.0_x5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update &lt;code&gt;.terraformrc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;provider_installation&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;filesystem_mirror&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;path&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/home/unknown/.terraform.d/plugins-local"&lt;/span&gt;
    &lt;span class="nx"&gt;include&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"hashicorp/random"&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;direct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;exclude&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"hashicorp/random"&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  8. Troubleshooting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  "Installed provider (signed by HashiCorp partner...)"
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; &lt;code&gt;.terraformrc&lt;/code&gt; not found or pattern doesn't match.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Ensure file is at &lt;code&gt;~/.terraformrc&lt;/code&gt; and &lt;code&gt;include&lt;/code&gt; uses this format &lt;code&gt;oracle/oci&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  "fork/exec ... permission denied"
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Terraform copied a &lt;code&gt;.zip&lt;/code&gt; file instead of the extracted binary.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Remove &lt;code&gt;.zip&lt;/code&gt; from the mirror directory; keep only the extracted binary.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Provider not found in any of the search locations"
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Wrong directory structure or binary naming.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Fix:&lt;/strong&gt; Verify path ends in &lt;code&gt;.../6.20.0/linux_amd64/terraform-provider-oci_v6.20.0_x5&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Quick Reference Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Verify mirror structure&lt;/span&gt;
find ~/.terraform.d/plugins-local &lt;span class="nt"&gt;-type&lt;/span&gt; f

&lt;span class="c"&gt;# Test if Terraform reads .terraformrc&lt;/span&gt;
&lt;span class="nv"&gt;TF_LOG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;DEBUG terraform init 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"filesystem_mirror&lt;/span&gt;&lt;span class="se"&gt;\|&lt;/span&gt;&lt;span class="s2"&gt;Explicit provider"&lt;/span&gt;

&lt;span class="c"&gt;# Force re-read backend and provider config&lt;/span&gt;
terraform init &lt;span class="nt"&gt;-reconfigure&lt;/span&gt;

&lt;span class="c"&gt;# Clean project cache (safe — providers stay in ~/.terraform.d)&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; .terraform/ .terraform.lock.hcl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.terraformrc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.terraformrc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tells Terraform where to find local providers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Provider binaries&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.terraform.d/plugins-local/...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The actual plugin executables&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;provider.tf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inside each project&lt;/td&gt;
&lt;td&gt;Declares which provider + version to use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.terraform.lock.hcl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inside each project&lt;/td&gt;
&lt;td&gt;Locks the provider version (tiny file)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; Your repositories stay clean, initialization is instant, and you are fully offline-capable.&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>devops</category>
      <category>cloud</category>
      <category>infrastructure</category>
    </item>
    <item>
      <title>Complete OCI Free Tier Infrastructure Guide Using Terraform - Part 03: Compute Layer (AMD &amp; ARM)</title>
      <dc:creator>sys-ronin</dc:creator>
      <pubDate>Fri, 07 Aug 2026 19:22:55 +0000</pubDate>
      <link>https://dev.to/sys-ronin/complete-oci-free-tier-infrastructure-guide-part-03-compute-layer-amd-arm-26c</link>
      <guid>https://dev.to/sys-ronin/complete-oci-free-tier-infrastructure-guide-part-03-compute-layer-amd-arm-26c</guid>
      <description>&lt;p&gt;In &lt;strong&gt;Part 01&lt;/strong&gt; and &lt;strong&gt;Part 02&lt;/strong&gt; of this series, we configured local API keys, environment variables, created an offline provider mirror, built our remote state bucket, and provisioned the shared networking layer (VCN, public subnet, route tables, and security lists).&lt;/p&gt;

&lt;p&gt;Now in &lt;strong&gt;Part 03&lt;/strong&gt;, we complete the series by building the compute layer across two isolated directories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;~/oci-infra/vm-amd/&lt;/code&gt; — x86 Architecture (&lt;code&gt;VM.Standard.E2.1.Micro&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~/oci-infra/vm-arm/&lt;/code&gt; — ARM Ampere Architecture (&lt;code&gt;VM.Standard.A1.Flex&lt;/code&gt; configured with &lt;strong&gt;1 OCPU&lt;/strong&gt; and &lt;strong&gt;6 GB RAM&lt;/strong&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both instances connect directly to the &lt;code&gt;shared-public-subnet&lt;/code&gt; provisioned in Part 02 and persist state to their dedicated S3-compatible backend paths (&lt;code&gt;vm-amd.tfstate&lt;/code&gt; and &lt;code&gt;vm-arm.tfstate&lt;/code&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  Section 1: AMD x86 Compute Instance (&lt;code&gt;~/oci-infra/vm-amd/&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;The AMD instance leverages the Always Free &lt;code&gt;VM.Standard.E2.1.Micro&lt;/code&gt; shape (1 OCPU, 1 GB RAM, 50 GB boot volume).&lt;/p&gt;

&lt;h3&gt;
  
  
  1.1 Provider &amp;amp; Remote State (&lt;code&gt;provider.tf&lt;/code&gt; &amp;amp; &lt;code&gt;backend.tf&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;provider.tf&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;required_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;gt;= 1.5.0"&lt;/span&gt;
  &lt;span class="nx"&gt;required_providers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;oci&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;source&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;
      &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"6.20.0"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"oci"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;
  &lt;span class="nx"&gt;user_ocid&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user_ocid&lt;/span&gt;
  &lt;span class="nx"&gt;fingerprint&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fingerprint&lt;/span&gt;
  &lt;span class="nx"&gt;private_key_path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;private_key_path&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;region&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;backend.tf&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;backend&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"terraform-states"&lt;/span&gt;
    &lt;span class="nx"&gt;key&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"vm-amd.tfstate"&lt;/span&gt;
    &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ap-hyderabad-1"&lt;/span&gt;
    &lt;span class="nx"&gt;endpoints&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://axjetxazylvl.compat.objectstorage.ap-hyderabad-1.oraclecloud.com"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;skip_region_validation&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_credentials_validation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_metadata_api_check&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_requesting_account_id&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_s3_checksum&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;use_path_style&lt;/span&gt;              &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.2 Data Resources (&lt;code&gt;data.tf&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Fetch availability domains&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"oci_identity_availability_domains"&lt;/span&gt; &lt;span class="s2"&gt;"ads"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;locals&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;first_ad&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;oci_identity_availability_domains&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ads&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;availability_domains&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# Image lookup for Oracle Linux 9 on x86_64&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_images"&lt;/span&gt; &lt;span class="s2"&gt;"ol9"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;operating_system&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Oracle Linux"&lt;/span&gt;
  &lt;span class="nx"&gt;operating_system_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"9"&lt;/span&gt;
  &lt;span class="nx"&gt;shape&lt;/span&gt;                    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"VM.Standard.E2.1.Micro"&lt;/span&gt;
  &lt;span class="nx"&gt;sort_by&lt;/span&gt;                  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"TIMECREATED"&lt;/span&gt;
  &lt;span class="nx"&gt;sort_order&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"DESC"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# Network lookup: find the shared subnet by display name&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_subnets"&lt;/span&gt; &lt;span class="s2"&gt;"shared"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;

  &lt;span class="nx"&gt;filter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;name&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"display_name"&lt;/span&gt;
    &lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"shared-public-subnet"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.3 Variables (&lt;code&gt;variables.tf&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"tenancy_ocid"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the tenancy"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"user_ocid"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the user"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"fingerprint"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"API key fingerprint"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"private_key_path"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Path to the private API key"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"region"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCI region"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"compartment_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the compartment"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"ssh_public_key_path"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Path to SSH public key"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.4 Resource Definition (&lt;code&gt;main.tf&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;locals&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ssh_private_key_path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;trimsuffix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pathexpand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ssh_public_key_path&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s2"&gt;".pub"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_instance"&lt;/span&gt; &lt;span class="s2"&gt;"amd"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;availability_domain&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first_ad&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;display_name&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"amd-vm"&lt;/span&gt;
  &lt;span class="nx"&gt;shape&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"VM.Standard.E2.1.Micro"&lt;/span&gt;

  &lt;span class="nx"&gt;source_details&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;source_type&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"image"&lt;/span&gt;
    &lt;span class="nx"&gt;source_id&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;oci_core_images&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ol9&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;images&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
    &lt;span class="nx"&gt;boot_volume_size_in_gbs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;create_vnic_details&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;subnet_id&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;oci_core_subnets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shared&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subnets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
    &lt;span class="nx"&gt;display_name&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"amd-vm-vnic"&lt;/span&gt;
    &lt;span class="nx"&gt;assign_public_ip&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;metadata&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ssh_authorized_keys&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pathexpand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ssh_public_key_path&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;preserve_boot_volume&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.5 Outputs (&lt;code&gt;outputs.tf&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"instance_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;amd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"public_ip"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;amd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public_ip&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"ssh_command"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ssh -i ${local.ssh_private_key_path} opc@${oci_core_instance.amd.public_ip}"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Section 2: ARM Ampere Flex Compute Instance (&lt;code&gt;~/oci-infra/vm-arm/&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;The ARM Ampere instance utilizes &lt;code&gt;VM.Standard.A1.Flex&lt;/code&gt; configured explicitly with &lt;strong&gt;1 OCPU&lt;/strong&gt; and &lt;strong&gt;6 GB RAM&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 Provider &amp;amp; Remote State (&lt;code&gt;provider.tf&lt;/code&gt; &amp;amp; &lt;code&gt;backend.tf&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;provider.tf&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;required_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;gt;= 1.5.0"&lt;/span&gt;
  &lt;span class="nx"&gt;required_providers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;oci&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;source&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;
      &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"6.20.0"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"oci"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;
  &lt;span class="nx"&gt;user_ocid&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user_ocid&lt;/span&gt;
  &lt;span class="nx"&gt;fingerprint&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fingerprint&lt;/span&gt;
  &lt;span class="nx"&gt;private_key_path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;private_key_path&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;region&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;backend.tf&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;backend&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"terraform-states"&lt;/span&gt;
    &lt;span class="nx"&gt;key&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"vm-arm.tfstate"&lt;/span&gt;
    &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ap-hyderabad-1"&lt;/span&gt;
    &lt;span class="nx"&gt;endpoints&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://axjetxazylvl.compat.objectstorage.ap-hyderabad-1.oraclecloud.com"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;skip_region_validation&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_credentials_validation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_metadata_api_check&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_requesting_account_id&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_s3_checksum&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;use_path_style&lt;/span&gt;              &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.2 Data Resources (&lt;code&gt;data.tf&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Availability Domains&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"oci_identity_availability_domains"&lt;/span&gt; &lt;span class="s2"&gt;"ads"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;locals&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;first_ad&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;oci_identity_availability_domains&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ads&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;availability_domains&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Image Lookup: Oracle Linux 9 for A1.Flex (ARM)&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_images"&lt;/span&gt; &lt;span class="s2"&gt;"ol9"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;operating_system&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Oracle Linux"&lt;/span&gt;
  &lt;span class="nx"&gt;operating_system_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"9"&lt;/span&gt;
  &lt;span class="nx"&gt;shape&lt;/span&gt;                    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"VM.Standard.A1.Flex"&lt;/span&gt;
  &lt;span class="nx"&gt;sort_by&lt;/span&gt;                  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"TIMECREATED"&lt;/span&gt;
  &lt;span class="nx"&gt;sort_order&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"DESC"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Network Discovery: Find the shared subnet by name&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_subnets"&lt;/span&gt; &lt;span class="s2"&gt;"shared"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;

  &lt;span class="nx"&gt;filter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;name&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"display_name"&lt;/span&gt;
    &lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"shared-public-subnet"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.3 Variables (&lt;code&gt;variables.tf&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"tenancy_ocid"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the tenancy"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"user_ocid"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the user"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"fingerprint"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"API key fingerprint"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"private_key_path"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Path to the private API key"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"region"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCI region"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"compartment_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the compartment to create resources in"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"ssh_public_key_path"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Path to the SSH public key for instance access"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.4 Resource Definition (&lt;code&gt;main.tf&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;locals&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ssh_private_key_path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;trimsuffix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pathexpand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ssh_public_key_path&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s2"&gt;".pub"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_instance"&lt;/span&gt; &lt;span class="s2"&gt;"arm"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;availability_domain&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first_ad&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;display_name&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"arm-vm"&lt;/span&gt;
  &lt;span class="nx"&gt;shape&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"VM.Standard.A1.Flex"&lt;/span&gt;

  &lt;span class="nx"&gt;shape_config&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ocpus&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="nx"&gt;memory_in_gbs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;source_details&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;source_type&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"image"&lt;/span&gt;
    &lt;span class="nx"&gt;source_id&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;oci_core_images&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ol9&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;images&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
    &lt;span class="nx"&gt;boot_volume_size_in_gbs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;create_vnic_details&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;subnet_id&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;oci_core_subnets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shared&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subnets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
    &lt;span class="nx"&gt;display_name&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"arm-vm-vnic"&lt;/span&gt;
    &lt;span class="nx"&gt;assign_public_ip&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;metadata&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ssh_authorized_keys&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pathexpand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ssh_public_key_path&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;preserve_boot_volume&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.5 Outputs (&lt;code&gt;outputs.tf&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"instance_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the ARM instance"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"instance_name"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Display name of the ARM instance"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;display_name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"shape"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Shape of the ARM instance"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shape&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"ocpus"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Configured OCPUs"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shape_config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;ocpus&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"memory_in_gbs"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Configured memory in GBs"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shape_config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;memory_in_gbs&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"availability_domain"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Availability domain of the ARM instance"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;availability_domain&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"private_ip"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Private IP address of the ARM instance"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;private_ip&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"public_ip"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Public IP address of the ARM instance"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public_ip&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"subnet_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the attached subnet"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create_vnic_details&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;subnet_id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"image_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the boot image used"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;source_details&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;source_id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"ssh_username"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Default SSH username"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"opc"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"ssh_command"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"SSH command to connect to the instance"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ssh -i ${local.ssh_private_key_path} opc@${oci_core_instance.arm.public_ip}"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Section 3: Deployment &amp;amp; Verification Workflow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Deploying the AMD x86 Workload
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/oci-infra/vm-amd/
terraform init
terraform plan
terraform apply &lt;span class="nt"&gt;-auto-approve&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.2 Deploying the ARM Ampere Workload
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/oci-infra/vm-arm/
terraform init
terraform plan
terraform apply &lt;span class="nt"&gt;-auto-approve&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.3 Accessing the Instances
&lt;/h3&gt;

&lt;p&gt;Upon completion, retrieve the SSH commands from the output variables or run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# SSH into AMD Instance&lt;/span&gt;
ssh &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/oci_vm_key opc@&amp;lt;AMD_PUBLIC_IP&amp;gt;

&lt;span class="c"&gt;# SSH into ARM Instance&lt;/span&gt;
ssh &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/oci_vm_key opc@&amp;lt;ARM_PUBLIC_IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Series Conclusion
&lt;/h2&gt;

&lt;p&gt;You have successfully built an automated, production-grade cloud foundation on Oracle Cloud Infrastructure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Part 01:&lt;/strong&gt; Setup environment authentication, API keys, offline provider mirror, and remote state bucket (&lt;code&gt;terraform-states&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Part 02:&lt;/strong&gt; Provisioned core networking (&lt;code&gt;main-vcn&lt;/code&gt;, &lt;code&gt;shared-public-subnet&lt;/code&gt;, internet gateway, security list) and application object storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Part 03:&lt;/strong&gt; Deployed modular AMD (&lt;code&gt;VM.Standard.E2.1.Micro&lt;/code&gt;) and ARM (&lt;code&gt;VM.Standard.A1.Flex&lt;/code&gt; with &lt;strong&gt;1 OCPU&lt;/strong&gt; and &lt;strong&gt;6 GB RAM&lt;/strong&gt;) compute instances attached to the shared subnet and state backends.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>terraform</category>
      <category>oraclecloud</category>
      <category>devops</category>
      <category>compute</category>
    </item>
    <item>
      <title>Complete OCI Free Tier Infrastructure Guide Using Terraform - Part 02: Shared Architecture Layer</title>
      <dc:creator>sys-ronin</dc:creator>
      <pubDate>Fri, 07 Aug 2026 19:21:24 +0000</pubDate>
      <link>https://dev.to/sys-ronin/complete-oci-free-tier-infrastructure-guide-part-02-shared-architecture-layer-gen</link>
      <guid>https://dev.to/sys-ronin/complete-oci-free-tier-infrastructure-guide-part-02-shared-architecture-layer-gen</guid>
      <description>&lt;p&gt;In &lt;strong&gt;Part 01&lt;/strong&gt; of this guide, we configured local keys, exported shell variables, created an offline provider mirror, and established our remote state bucket.&lt;/p&gt;

&lt;p&gt;Now in &lt;strong&gt;Part 02&lt;/strong&gt;, we build the foundation of our cloud environment in &lt;code&gt;~/oci-infra/shared/&lt;/code&gt;. This shared architecture layer provisions the core Virtual Cloud Network (VCN), internet gateway, public subnet, security rules, standard Object Storage bucket, and S3-compatible remote state backend configuration [cite: 2, 3].&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Provider Configuration (&lt;code&gt;provider.tf&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Defines the required Terraform engine and provider versions [cite: 5], along with authentication credentials passed via shell environment variables [cite: 5, 6].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;required_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;gt;= 1.5.0"&lt;/span&gt;
  &lt;span class="nx"&gt;required_providers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;oci&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;source&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;
      &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"6.20.0"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"oci"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tenancy_ocid&lt;/span&gt;
  &lt;span class="nx"&gt;user_ocid&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user_ocid&lt;/span&gt;
  &lt;span class="nx"&gt;fingerprint&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fingerprint&lt;/span&gt;
  &lt;span class="nx"&gt;private_key_path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;private_key_path&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;region&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Terraform Engine:&lt;/strong&gt; Requires version &lt;code&gt;&amp;gt;= 1.5.0&lt;/code&gt; [cite: 5].&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OCI Provider:&lt;/strong&gt; Pins the &lt;code&gt;oracle/oci&lt;/code&gt; provider to version &lt;code&gt;6.20.0&lt;/code&gt; [cite: 5].&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication:&lt;/strong&gt; Uses API key configuration via tenancy OCID, user OCID, fingerprint, private key path, and region [cite: 5].&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Environment Variables (&lt;code&gt;variables.tf&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Defines the required input variables used to configure authentication and resource placement [cite: 6].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"tenancy_ocid"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the tenancy"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"user_ocid"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the user"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"fingerprint"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"API key fingerprint"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"private_key_path"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Path to the private API key"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"region"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCI region"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"compartment_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the compartment to create resources in"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Remote State Backend (&lt;code&gt;backend.tf&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Configures Terraform to store state remotely inside an OCI Object Storage bucket using the S3-compatible API [cite: 2].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;backend&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"terraform-states"&lt;/span&gt;
    &lt;span class="nx"&gt;key&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"shared.tfstate"&lt;/span&gt;
    &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ap-hyderabad-1"&lt;/span&gt;
    &lt;span class="nx"&gt;endpoints&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://axjetxazylvl.compat.objectstorage.ap-hyderabad-1.oraclecloud.com"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;skip_region_validation&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_credentials_validation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_metadata_api_check&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_requesting_account_id&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;skip_s3_checksum&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;use_path_style&lt;/span&gt;              &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bucket &amp;amp; State Key:&lt;/strong&gt; Stores the state in &lt;code&gt;terraform-states&lt;/code&gt; under &lt;code&gt;shared.tfstate&lt;/code&gt; [cite: 2].&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;S3 Compatibility Endpoint:&lt;/strong&gt; Points directly to OCI's native S3 API endpoint (&lt;code&gt;https://axjetxazylvl.compat.objectstorage.ap-hyderabad-1.oraclecloud.com&lt;/code&gt;) [cite: 2].&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS S3 Overrides:&lt;/strong&gt; Forces path-style addressing (&lt;code&gt;use_path_style = true&lt;/code&gt;) and disables standard AWS-specific checks (checksums, metadata API, credentials validation) to maintain OCI compatibility [cite: 2].&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Main Infrastructure Resources (&lt;code&gt;main.tf&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Contains resources for the Virtual Cloud Network (VCN), networking gateway, security list, public subnet, and storage bucket [cite: 3].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Virtual Cloud Network&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_vcn"&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;cidr_block&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.0.0/16"&lt;/span&gt;
  &lt;span class="nx"&gt;display_name&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"main-vcn"&lt;/span&gt;
  &lt;span class="nx"&gt;dns_label&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"mainvcn"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Internet Gateway&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_internet_gateway"&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;vcn_id&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_vcn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;display_name&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"main-igw"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Route Table&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_route_table"&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;vcn_id&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_vcn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;display_name&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"public-route-table"&lt;/span&gt;

  &lt;span class="nx"&gt;route_rules&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;destination&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;
    &lt;span class="nx"&gt;destination_type&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CIDR_BLOCK"&lt;/span&gt;
    &lt;span class="nx"&gt;network_entity_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_internet_gateway&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Security List&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_security_list"&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;vcn_id&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_vcn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;display_name&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"public-security-list"&lt;/span&gt;

  &lt;span class="c1"&gt;# SSH from anywhere&lt;/span&gt;
  &lt;span class="nx"&gt;ingress_security_rules&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"6"&lt;/span&gt; &lt;span class="c1"&gt;# TCP&lt;/span&gt;
    &lt;span class="nx"&gt;source&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;
    &lt;span class="nx"&gt;source_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CIDR_BLOCK"&lt;/span&gt;
    &lt;span class="nx"&gt;tcp_options&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;min&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
      &lt;span class="nx"&gt;max&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;# ICMP for MTU path discovery (required by OCI)&lt;/span&gt;
  &lt;span class="nx"&gt;ingress_security_rules&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt; &lt;span class="c1"&gt;# ICMP&lt;/span&gt;
    &lt;span class="nx"&gt;source&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;
    &lt;span class="nx"&gt;source_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CIDR_BLOCK"&lt;/span&gt;
    &lt;span class="nx"&gt;icmp_options&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
      &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;# Allow ping (ICMP echo request/reply)&lt;/span&gt;
  &lt;span class="nx"&gt;ingress_security_rules&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt; &lt;span class="c1"&gt;# ICMP&lt;/span&gt;
    &lt;span class="nx"&gt;source&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;
    &lt;span class="nx"&gt;source_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CIDR_BLOCK"&lt;/span&gt;
    &lt;span class="nx"&gt;icmp_options&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;  &lt;span class="c1"&gt;# Echo Request&lt;/span&gt;
      &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;-1&lt;/span&gt; &lt;span class="c1"&gt;# All codes&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;# Allow all outbound&lt;/span&gt;
  &lt;span class="nx"&gt;egress_security_rules&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"all"&lt;/span&gt;
    &lt;span class="nx"&gt;destination&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Subnet&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"oci_core_subnet"&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;vcn_id&lt;/span&gt;                     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_vcn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;cidr_block&lt;/span&gt;                 &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.0.0/24"&lt;/span&gt;
  &lt;span class="nx"&gt;display_name&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"shared-public-subnet"&lt;/span&gt;
  &lt;span class="nx"&gt;dns_label&lt;/span&gt;                  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt;
  &lt;span class="nx"&gt;route_table_id&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_route_table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;security_list_ids&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;oci_core_security_list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="nx"&gt;prohibit_public_ip_on_vnic&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;# Object Storage Bucket&lt;/span&gt;
&lt;span class="c1"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"oci_objectstorage_bucket"&lt;/span&gt; &lt;span class="s2"&gt;"infra_data"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;compartment_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compartment_id&lt;/span&gt;
  &lt;span class="nx"&gt;namespace&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"axjetxazylvl"&lt;/span&gt;
  &lt;span class="nx"&gt;name&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"infra-data"&lt;/span&gt;
  &lt;span class="nx"&gt;storage_tier&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Standard"&lt;/span&gt;
  &lt;span class="nx"&gt;access_type&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"NoPublicAccess"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Resource Breakdown
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VCN (&lt;code&gt;oci_core_vcn.main&lt;/code&gt;):&lt;/strong&gt; Named &lt;code&gt;main-vcn&lt;/code&gt; with CIDR &lt;code&gt;10.0.0.0/16&lt;/code&gt; and internal DNS label &lt;code&gt;mainvcn&lt;/code&gt; [cite: 3].&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internet Gateway (&lt;code&gt;oci_core_internet_gateway.main&lt;/code&gt;):&lt;/strong&gt; Named &lt;code&gt;main-igw&lt;/code&gt;, allowing outbound internet connection for instances [cite: 3].&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Route Table (&lt;code&gt;oci_core_route_table.public&lt;/code&gt;):&lt;/strong&gt; Directs default outbound traffic (&lt;code&gt;0.0.0.0/0&lt;/code&gt;) through the Internet Gateway [cite: 3].&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security List (&lt;code&gt;oci_core_security_list.public&lt;/code&gt;):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;TCP port 22 (SSH) allowed from anywhere (&lt;code&gt;0.0.0.0/0&lt;/code&gt;) [cite: 3].&lt;/li&gt;
&lt;li&gt;ICMP Type 3 Code 4 enabled (required by OCI for path MTU discovery) [cite: 3].&lt;/li&gt;
&lt;li&gt;ICMP Type 8 (Echo Request / Ping) enabled [cite: 3].&lt;/li&gt;
&lt;li&gt;Full egress traffic (&lt;code&gt;0.0.0.0/0&lt;/code&gt;) allowed [cite: 3].&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Subnet (&lt;code&gt;oci_core_subnet.public&lt;/code&gt;):&lt;/strong&gt; CIDR block &lt;code&gt;10.0.0.0/24&lt;/code&gt;, attached to the public route table and public security list, with public IPs allowed (&lt;code&gt;prohibit_public_ip_on_vnic = false&lt;/code&gt;) [cite: 3].&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Object Storage Bucket (&lt;code&gt;oci_objectstorage_bucket.infra_data&lt;/code&gt;):&lt;/strong&gt; Named &lt;code&gt;infra-data&lt;/code&gt;, using namespace &lt;code&gt;axjetxazylvl&lt;/code&gt;, standard storage tier, and &lt;code&gt;NoPublicAccess&lt;/code&gt; [cite: 3].&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Architectural Outputs (&lt;code&gt;outputs.tf&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Exposes critical resource IDs and attributes for reference by isolated sub-modules (such as compute instances) [cite: 4].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"vcn_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the created VCN"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_vcn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"vcn_cidr"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CIDR block of the VCN"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_vcn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cidr_block&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"vcn_dns_label"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"DNS label of the VCN"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_vcn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dns_label&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"subnet_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the public subnet"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"subnet_cidr"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CIDR block of the public subnet"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cidr_block&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"subnet_dns_label"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"DNS label of the public subnet"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dns_label&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"internet_gateway_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the Internet Gateway"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_internet_gateway&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"security_list_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"OCID of the Security List"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_core_security_list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"infra_bucket_name"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Name of the application bucket"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_objectstorage_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;infra_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"infra_bucket_namespace"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Namespace of the application bucket"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oci_objectstorage_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;infra_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;namespace&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"infra_bucket_endpoint"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"S3-compatible endpoint for the application bucket"&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://${oci_objectstorage_bucket.infra_data.namespace}.compat.objectstorage.${var.region}.oraclecloud.com"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Execution Workflow
&lt;/h2&gt;

&lt;p&gt;From inside the &lt;code&gt;~/oci-infra/shared/&lt;/code&gt; directory, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Initialize using the local provider mirror and remote S3 state backend&lt;/span&gt;
terraform init

&lt;span class="c"&gt;# Review execution plan&lt;/span&gt;
terraform plan

&lt;span class="c"&gt;# Apply infrastructure changes&lt;/span&gt;
terraform apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;With your shared core networking, security rules, and state storage provisioned, your tenancy foundation is complete.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Part 03&lt;/strong&gt;, we will provision the compute layer—deploying Always Free x86 (&lt;code&gt;vm-amd&lt;/code&gt;) and ARM Ampere (&lt;code&gt;vm-arm&lt;/code&gt;) instances connected directly to &lt;code&gt;shared-public-subnet&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>oraclecloud</category>
      <category>devops</category>
      <category>networking</category>
    </item>
    <item>
      <title>Complete OCI Free Tier Infrastructure Guide Using Terraform - Part 01: Setup &amp; Local Provider Mirror</title>
      <dc:creator>sys-ronin</dc:creator>
      <pubDate>Fri, 07 Aug 2026 19:11:40 +0000</pubDate>
      <link>https://dev.to/sys-ronin/oracle-cloud-free-tier-infrastructure-using-terraform-part-01-5hnc</link>
      <guid>https://dev.to/sys-ronin/oracle-cloud-free-tier-infrastructure-using-terraform-part-01-5hnc</guid>
      <description>&lt;p&gt;Setting up Oracle Cloud Infrastructure (OCI) using Terraform gives you an automated, reproducible "Always Free" cloud environment. However, managing backend state safely and dealing with air-gapped or restricted provider installations can introduce friction.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Part 01&lt;/strong&gt; of this series, we walk through configuring local credentials, OCI API integration, an S3-compatible backend for state management, an air-gapped local Terraform provider mirror, and a modular folder structure.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A local Linux machine (Debian/Ubuntu preferred) or WSL environment.&lt;/li&gt;
&lt;li&gt;An active &lt;strong&gt;Oracle Cloud Infrastructure (OCI) Free Tier&lt;/strong&gt; account.&lt;/li&gt;
&lt;li&gt;OpenSSL, SSH, and Terraform installed.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Phase 1: Local Machine Setup
&lt;/h2&gt;

&lt;p&gt;Generate local cryptographic keys required for SSH access to your instances and secure API authentication with OCI.&lt;/p&gt;

&lt;h3&gt;
  
  
  1.1 Generate SSH Key Pair (ED25519)
&lt;/h3&gt;

&lt;p&gt;Generate a high-security ED25519 key pair without a passphrase for non-interactive infrastructure management:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-N&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"oci_vm_key"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; ~/.ssh/oci_vm_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This generates two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private key:&lt;/strong&gt; &lt;code&gt;~/.ssh/oci_vm_key&lt;/code&gt; &lt;em&gt;(keep safe)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public key:&lt;/strong&gt; &lt;code&gt;~/.ssh/oci_vm_key.pub&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1.2 Create OCI API Key Directory
&lt;/h3&gt;

&lt;p&gt;Restrict permissions on the configuration directory to preserve security standards:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.oci
&lt;span class="nb"&gt;chmod &lt;/span&gt;700 ~/.oci
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.3 Generate OCI API Key Pair (RSA 4096)
&lt;/h3&gt;

&lt;p&gt;OCI requires an RSA 4096-bit key pair for programmatic API authentication:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Generate private key&lt;/span&gt;
openssl genrsa &lt;span class="nt"&gt;-out&lt;/span&gt; ~/.oci/oci.pem 4096

&lt;span class="c"&gt;# Generate public key&lt;/span&gt;
openssl rsa &lt;span class="nt"&gt;-pubout&lt;/span&gt; &lt;span class="nt"&gt;-in&lt;/span&gt; ~/.oci/oci.pem &lt;span class="nt"&gt;-out&lt;/span&gt; ~/.oci/oci_public.pem

&lt;span class="c"&gt;# Secure permissions (OCI rejects keys with permissions broader than 600)&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;600 ~/.oci/oci.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.4 Generate Key Fingerprint
&lt;/h3&gt;

&lt;p&gt;Extract the MD5 fingerprint of your public key. You will need this to verify API connectivity in the OCI Console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openssl rsa &lt;span class="nt"&gt;-pubout&lt;/span&gt; &lt;span class="nt"&gt;-in&lt;/span&gt; ~/.oci/oci.pem &lt;span class="nt"&gt;-outform&lt;/span&gt; DER | openssl md5 &lt;span class="nt"&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;Output Example:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;MD5(stdin)= 57:0d:ea:8c:07:11:22:33:44:55:66:77:88:99:aa:bb&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Phase 2: OCI Console Configuration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1 Upload API Public Key
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Log into your &lt;strong&gt;OCI Console&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Profile&lt;/strong&gt; (top right icon) → &lt;strong&gt;My Profile&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Resources&lt;/strong&gt; (bottom left), click &lt;strong&gt;API Keys&lt;/strong&gt; → &lt;strong&gt;Add API Key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Paste a Public Key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Output the contents of &lt;code&gt;~/.oci/oci_public.pem&lt;/code&gt; and paste them into the text box:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cat&lt;/span&gt; ~/.oci/oci_public.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;🔒 &lt;strong&gt;Save Configuration Details:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A &lt;em&gt;Configuration File Preview&lt;/em&gt; popup will appear. Copy these values—they contain your &lt;code&gt;user&lt;/code&gt; OCID, &lt;code&gt;tenancy&lt;/code&gt; OCID, &lt;code&gt;fingerprint&lt;/code&gt;, and your home &lt;code&gt;region&lt;/code&gt; (e.g., &lt;code&gt;ap-hyderabad-1&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2.2 Retrieve Object Storage Namespace
&lt;/h3&gt;

&lt;p&gt;Your Object Storage namespace is a unique, system-generated string tied to your tenant. Retrieve it using the OCI CLI or Cloud Shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oci os ns get
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Expected JSON output:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"axjetxbzylvl"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.3 Create the Terraform Remote State Bucket
&lt;/h3&gt;

&lt;p&gt;Store your &lt;code&gt;.tfstate&lt;/code&gt; files remotely in OCI Object Storage:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Object Storage&lt;/strong&gt; → &lt;strong&gt;Buckets&lt;/strong&gt; in the OCI Console.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Bucket&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill in the parameters:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bucket Name:&lt;/strong&gt; &lt;code&gt;terraform-states&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Default Storage Tier:&lt;/strong&gt; &lt;code&gt;Standard&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visibility:&lt;/strong&gt; &lt;code&gt;Private&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Region:&lt;/strong&gt; &lt;em&gt;Select your Home Region&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  2.4 Generate S3-Compatible Credentials
&lt;/h3&gt;

&lt;p&gt;OCI Object Storage provides an S3-compatible API endpoint, allowing you to use standard S3 backend configurations in Terraform.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Profile&lt;/strong&gt; → &lt;strong&gt;My Profile&lt;/strong&gt; → &lt;strong&gt;Customer Secret Keys&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Generate Secret Key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter a display name: &lt;code&gt;terraform-backend&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Generate Secret Key&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Important:&lt;/strong&gt; Copy and save the generated &lt;strong&gt;Secret Key&lt;/strong&gt; immediately. It will never be displayed again.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Access Key:&lt;/strong&gt; Visible in the Customer Secret Keys table (e.g., &lt;code&gt;f4068126c6fd14c08a121d17396u317e6144e6a2&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secret Key:&lt;/strong&gt; Copied from the modal dialog.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Phase 3: Shell Environment Setup (&lt;code&gt;~/.bashrc&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;To prevent hardcoding sensitive credentials inside your Terraform code, export them as environment variables.&lt;/p&gt;

&lt;p&gt;Add the following block to the bottom of your &lt;code&gt;~/.bashrc&lt;/code&gt; file (replace placeholders with your actual OCIDs, keys, and paths):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="c"&gt;# OCI Provider Credentials&lt;/span&gt;
&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_tenancy_ocid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ocid1.tenancy.oc1..aaaaaaaa..."&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_user_ocid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ocid1.user.oc1..aaaaaaaa..."&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_fingerprint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"57:0d:ea:8c:07:..."&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_private_key_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.oci/oci.pem"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ap-hyderabad-1"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_compartment_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ocid1.tenancy.oc1..aaaaaaaa..."&lt;/span&gt;

&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="c"&gt;# S3-Compatible Backend Credentials (OCI Object Storage S3 API)&lt;/span&gt;
&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_ACCESS_KEY_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"f4068126c6..."&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR_SECRET_KEY_HERE"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_REQUEST_CHECKSUM_CALCULATION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;when_required

&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="c"&gt;# Backend Configuration Variables&lt;/span&gt;
&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_backend_bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"terraform-states"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_backend_namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"axjftxazylvl"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_backend_region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ap-hyderabad-1"&lt;/span&gt;

&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="c"&gt;# SSH Key for VM Provisioning&lt;/span&gt;
&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TF_VAR_ssh_public_key_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.ssh/oci_vm_key.pub"&lt;/span&gt;

&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="c"&gt;# OCI CLI Path &amp;amp; Autocomplete (Adjust path to your user home)&lt;/span&gt;
&lt;span class="c"&gt;# =============================================================================&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/lib/oracle-cli/lib/python3.13/site-packages/oci_cli/bin/oci_autocomplete.sh"&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/lib/oracle-cli/lib/python3.13/site-packages/oci_cli/bin/oci_autocomplete.sh"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply the environment changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Phase 4: Offline / Local Provider Mirror Configuration
&lt;/h2&gt;

&lt;p&gt;If you want fast execution or operate in an environment with limited internet access, you can mirror the official OCI provider locally.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.1 Create Directory Structure
&lt;/h3&gt;

&lt;p&gt;Build the target plugin directory structure expected by Terraform for &lt;code&gt;oracle/oci&lt;/code&gt; version &lt;code&gt;6.20.0&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.terraform.d/plugins-local/registry.terraform.io/oracle/oci/6.20.0/linux_amd64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4.2 Download and Unpack Provider Binary
&lt;/h3&gt;

&lt;p&gt;Download &lt;code&gt;terraform-provider-oci_6.20.0_linux_amd64.zip&lt;/code&gt; directly from the HashiCorp or Oracle releases registry, place it in the created path, and unpack it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/.terraform.d/plugins-local/registry.terraform.io/oracle/oci/6.20.0/linux_amd64

&lt;span class="c"&gt;# Unzip binary package&lt;/span&gt;
unzip terraform-provider-oci_6.20.0_linux_amd64.zip

&lt;span class="c"&gt;# Rename provider binary to append protocol version target&lt;/span&gt;
&lt;span class="nb"&gt;mv &lt;/span&gt;terraform-provider-oci_v6.20.0 terraform-provider-oci_v6.20.0_x5

&lt;span class="c"&gt;# Clean up archive&lt;/span&gt;
&lt;span class="nb"&gt;rm &lt;/span&gt;terraform-provider-oci_6.20.0_linux_amd64.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that your local mirror directory tree matches this structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.terraform.d/
└── plugins-local
    └── registry.terraform.io
        └── oracle
            └── oci
                └── 6.20.0
                    └── linux_amd64
                        └── terraform-provider-oci_v6.20.0_x5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4.3 Configure Global Provider Installation (&lt;code&gt;~/.terraformrc&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Create a global CLI configuration file at &lt;code&gt;~/.terraformrc&lt;/code&gt; to force Terraform to load the OCI provider directly from your filesystem mirror instead of downloading it during &lt;code&gt;terraform init&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;provider_installation&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;filesystem_mirror&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;path&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/home/YOUR_USER_NAME/.terraform.d/plugins-local"&lt;/span&gt;
    &lt;span class="nx"&gt;include&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;direct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;exclude&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"oracle/oci"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Note:&lt;/strong&gt; Replace &lt;code&gt;/home/YOUR_USER_NAME/&lt;/code&gt; with the absolute path to your home directory (Terraform does not expand &lt;code&gt;~&lt;/code&gt; inside &lt;code&gt;.terraformrc&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Phase 5: Project Directory Architecture
&lt;/h2&gt;

&lt;p&gt;To manage networking and compute instances independently without creating monolithic state files, isolate components into modular subdirectories:&lt;/p&gt;

&lt;p&gt;Create the workspace structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/oci-infra/&lt;span class="o"&gt;{&lt;/span&gt;shared,vm-amd,vm-arm&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/oci-infra/
├── shared/          # VCN, subnets, IGW, route tables, security lists, buckets
│   ├── backend.tf
│   ├── provider.tf
│   ├── variables.tf
│   ├── main.tf
│   └── outputs.tf
├── vm-amd/          # Always Free x86 Instance (E2.1.Micro + Oracle Linux 9)
│   ├── backend.tf
│   ├── provider.tf
│   ├── variables.tf
│   ├── data.tf
│   ├── main.tf
│   └── outputs.tf
└── vm-arm/          # Always Free ARM Instance (A1.Flex + Oracle Linux 9)
    ├── backend.tf
    ├── provider.tf
    ├── variables.tf
    ├── data.tf
    ├── main.tf
    └── outputs.tf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;With your API keys generated, environment variables configured, local provider mirrored, and project folders structured, your system is ready.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Part 02&lt;/strong&gt;, we will write the HCL declarations for the &lt;code&gt;shared/&lt;/code&gt; module—building a Virtual Cloud Network (VCN), public subnets, internet gateways, and locking down security lists within OCI Always Free limits.&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>oraclecloud</category>
      <category>devops</category>
      <category>linux</category>
    </item>
    <item>
      <title>Prior Art as Code: A practical guide to protecting open source innovations</title>
      <dc:creator>sys-ronin</dc:creator>
      <pubDate>Wed, 01 Jul 2026 13:06:53 +0000</pubDate>
      <link>https://dev.to/sys-ronin/prior-art-as-code-a-practical-guide-to-protecting-open-source-innovations-o96</link>
      <guid>https://dev.to/sys-ronin/prior-art-as-code-a-practical-guide-to-protecting-open-source-innovations-o96</guid>
      <description>&lt;h2&gt;
  
  
  Prior Art as Code: A Practical Guide
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Protect your open source project from patent trolls by embedding prior art in your repository
&lt;/h2&gt;




&lt;h2&gt;
  
  
  1. What Is Prior Art?
&lt;/h2&gt;

&lt;p&gt;Prior art is any public evidence that an invention already exists. Under US law (35 U.S.C. § 102(a)(1)), an invention cannot be patented if it was "described in a printed publication" before the filing date. Under European law (EPC Article 54(2)), the state of the art includes "everything made available to the public" before filing. The EPO's G 1/23 decision (2025) clarified that public availability alone is sufficient – no reproducibility required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prior art proves the invention was already known.&lt;/strong&gt; That makes any later patent invalid.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Why Prior Art Matters for Open Source
&lt;/h2&gt;

&lt;p&gt;Open source projects are prime targets for patent trolls because:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Threat&lt;/th&gt;
&lt;th&gt;Why It Matters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Code is public&lt;/td&gt;
&lt;td&gt;Trolls can scan for novel inventions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No patent budget&lt;/td&gt;
&lt;td&gt;Most open source projects cannot afford to file or defend patents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No legal team&lt;/td&gt;
&lt;td&gt;Individual contributors are vulnerable to lawsuits&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The solution is prior art.&lt;/strong&gt; It costs nothing, requires no legal fees, and blocks patents before they are filed.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The Problem with Traditional Defensive Publications
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Why It Fails&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Separate from code&lt;/td&gt;
&lt;td&gt;Hard to find, easy to ignore&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Expensive&lt;/td&gt;
&lt;td&gt;Many services charge fees (IP.com, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Static&lt;/td&gt;
&lt;td&gt;Rarely updated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not enabling&lt;/td&gt;
&lt;td&gt;Vague descriptions do not convince examiners&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unverifiable&lt;/td&gt;
&lt;td&gt;No working code to prove the invention works&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Traditional defensive publications are weak prior art.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Prior Art as Code: A Better Approach
&lt;/h2&gt;

&lt;p&gt;Prior art as code embeds prior art directly in your source repository. It provides:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Benefit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Integrated with code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Documents live alongside the implementation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Timestamped by Git&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Immutable proof of publication date&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Enabling disclosure&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Enough detail to re‑implement the invention&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Verifiable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Working code is the evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Free&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Public repositories cost nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Searchable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Patent examiners can find it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;This is stronger prior art.&lt;/strong&gt; It is enabling, verifiable, and timestamped.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Example: Thought OS
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Thought OS&lt;/strong&gt; is a real open source project that uses this approach. Its repository contains a comprehensive prior art document with various disclosed concepts, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UUID permanence (items keep identity across renames)&lt;/li&gt;
&lt;li&gt;Hardware binding without TPM&lt;/li&gt;
&lt;li&gt;Resurrection from Git history&lt;/li&gt;
&lt;li&gt;Active cache validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each concept is described in its own separate document, making it easy to update, reference, and understand individually. The main document indexes them all. This modular approach is recommended for complex projects.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For reference: &lt;a href="https://github.com/sjyotis/thought-os" rel="noopener noreferrer"&gt;https://github.com/sjyotis/thought-os&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  6. The Prior Art Document Itself Is Sufficient
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The prior art document alone, with working code and a timestamp, is sufficient to establish prior art and invalidate later patents.&lt;/strong&gt; The law itself provides the protection – 35 U.S.C. § 102(a)(1) and EPC Article 54(2) invalidate any patent that claims an invention already disclosed.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. How to Implement Prior Art as Code
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Identify Your Novel Inventions
&lt;/h3&gt;

&lt;p&gt;Ask: "What would I be angry about if someone else patented?"&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Write an Enabling Description
&lt;/h3&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plain language summary&lt;/li&gt;
&lt;li&gt;Technical specification (data structures, algorithms, protocols)&lt;/li&gt;
&lt;li&gt;Code references (files and line numbers)&lt;/li&gt;
&lt;li&gt;Diagrams (flowcharts, sequence diagrams)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Create Prior Art Documents
&lt;/h3&gt;

&lt;p&gt;For simple projects, a single &lt;code&gt;PRIOR_ART_DISCLOSURE.md&lt;/code&gt; is enough. For complex projects with multiple independent features, create &lt;strong&gt;separate documents per concept&lt;/strong&gt; in a &lt;code&gt;docs/&lt;/code&gt; folder (e.g., &lt;code&gt;docs/resurrection-engine.md&lt;/code&gt;, &lt;code&gt;docs/hardware-binding.md&lt;/code&gt;). Use a main &lt;code&gt;PRIOR_ART_DISCLOSURE.md&lt;/code&gt; as an index linking to each.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Timestamp with Git
&lt;/h3&gt;

&lt;p&gt;Commit the documents with a message like &lt;code&gt;docs: add prior art disclosure&lt;/code&gt;. The commit timestamp proves publication date.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Link It in Your README
&lt;/h3&gt;

&lt;p&gt;Make the prior art document easy to find. Patent examiners need to discover it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Publish Publicly
&lt;/h3&gt;

&lt;p&gt;Push to a public repository (GitHub, GitLab, etc.). Public availability is what matters.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Suggested Platforms for Publication
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Source code + documents&lt;/td&gt;
&lt;td&gt;The standard for open source; patent examiners search here&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GitLab&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Source code + documents&lt;/td&gt;
&lt;td&gt;Alternative to GitHub; also searchable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SourceForge&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Source code + documents&lt;/td&gt;
&lt;td&gt;Legacy platform, still indexed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IP.com&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Prior art submission&lt;/td&gt;
&lt;td&gt;Paid service, submitted to patent offices&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Zenodo&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Document publication&lt;/td&gt;
&lt;td&gt;Assigns DOI (persistent identifier)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;arXiv&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Technical papers&lt;/td&gt;
&lt;td&gt;Academic-style prior art&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hacker News&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Project announcements&lt;/td&gt;
&lt;td&gt;Creates social timestamp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dev.to&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Technical articles&lt;/td&gt;
&lt;td&gt;Searchable, indexed by Google&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Best practice:&lt;/strong&gt; Publish on GitHub + one other platform (e.g., Zenodo) for redundancy.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Optional: Patent‑Prohibiting License
&lt;/h2&gt;

&lt;p&gt;While the prior art document alone is sufficient to invalidate later patents, you may choose to add an explicit patent‑prohibiting license. Such a license:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explicitly forbids patenting of the disclosed concepts&lt;/li&gt;
&lt;li&gt;Provides a separate legal basis (contract law) to challenge a patent&lt;/li&gt;
&lt;li&gt;Sends a clear signal that the technology belongs to no one&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is &lt;strong&gt;optional&lt;/strong&gt;. The prior art is the shield. The license is an extra lock on the gate.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. Why Prior Art as Code Is Stronger
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;Traditional Prior Art&lt;/th&gt;
&lt;th&gt;Prior Art as Code&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Paid&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration&lt;/td&gt;
&lt;td&gt;Separate&lt;/td&gt;
&lt;td&gt;Integrated with code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timestamp&lt;/td&gt;
&lt;td&gt;Manual&lt;/td&gt;
&lt;td&gt;Git commits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enabling&lt;/td&gt;
&lt;td&gt;Often vague&lt;/td&gt;
&lt;td&gt;Detailed, with code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Verifiable&lt;/td&gt;
&lt;td&gt;Hard&lt;/td&gt;
&lt;td&gt;Working code is evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Modularity&lt;/td&gt;
&lt;td&gt;Single document&lt;/td&gt;
&lt;td&gt;Separate files per concept&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Prior art as code is stronger because it provides all the evidence needed.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  11. Conclusion
&lt;/h2&gt;

&lt;p&gt;Prior art as code is a free, effective way to protect open source projects from patents. It works by:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Establishing a public, timestamped, enabling disclosure&lt;/li&gt;
&lt;li&gt;Referencing the actual working code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The prior art document itself is sufficient.&lt;/strong&gt; The law (35 U.S.C. § 102(a)(1), EPC Article 54(2)) invalidates any later patent claiming the disclosed concepts. A patent‑prohibiting license is optional – it adds an extra layer but is not required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every open source project should consider prior art as code.&lt;/strong&gt; It costs nothing. It blocks patents. It protects innovation.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;sjyotis&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
June 2026&lt;br&gt;&lt;br&gt;
&lt;a href="mailto:thought-os@protonmail.com"&gt;thought-os@protonmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>github</category>
    </item>
    <item>
      <title>Prior Art: The data structure that shapes Thought OS</title>
      <dc:creator>sys-ronin</dc:creator>
      <pubDate>Fri, 19 Jun 2026 12:19:47 +0000</pubDate>
      <link>https://dev.to/sys-ronin/the-data-structure-that-shapes-thought-os-3h8b</link>
      <guid>https://dev.to/sys-ronin/the-data-structure-that-shapes-thought-os-3h8b</guid>
      <description>&lt;h1&gt;
  
  
  The Three‑File Architecture
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Foundation of the Entire System
&lt;/h2&gt;




&lt;h2&gt;
  
  
  1. The Division
&lt;/h2&gt;

&lt;p&gt;Every notebook repository contains exactly three JSON files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;structure.json&lt;/code&gt; – the notebook hierarchy: names, UUIDs, parent relationships, and references to notes and subnotebooks.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;notes.json&lt;/code&gt; – content of regular notes, keyed by UUID.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;files.json&lt;/code&gt; – content of file notes (any file type), also keyed by UUID.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation is the foundation upon which every other feature is built.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Why Three Files, Not One
&lt;/h2&gt;

&lt;p&gt;A single file containing everything (structure and all content) would create a single point of change for any modification. Every note edit would require rewriting the entire file. Git would store a full new version each time, regardless of delta compression, because the file would be completely different.&lt;/p&gt;

&lt;p&gt;By separating structure from content:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Renaming a notebook or moving a note changes only &lt;code&gt;structure.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Editing a note changes only &lt;code&gt;notes.json&lt;/code&gt; (or &lt;code&gt;files.json&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Adding a file changes only &lt;code&gt;files.json&lt;/code&gt; and &lt;code&gt;structure.json&lt;/code&gt; (but structure is a small addition).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each file evolves independently. Git stores deltas for each file separately, so a small change in &lt;code&gt;notes.json&lt;/code&gt; results in a small delta. The repository size grows with the number of changes, not with the number of versions times the total size.&lt;/p&gt;

&lt;p&gt;This is the primary mechanism that keeps the Git storage footprint low over years of use.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. UUID as the Common Key
&lt;/h2&gt;

&lt;p&gt;All three files use the same UUIDs to refer to notes and files.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;structure.json&lt;/code&gt; contains notes entries with &lt;code&gt;id&lt;/code&gt; fields.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;notes.json&lt;/code&gt; has keys equal to those UUIDs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;files.json&lt;/code&gt; also uses the same UUIDs as keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a note is created, a UUID is generated. That UUID is stored in &lt;code&gt;structure.json&lt;/code&gt; (as part of the note’s entry) and also becomes a key in &lt;code&gt;notes.json&lt;/code&gt; (or &lt;code&gt;files.json&lt;/code&gt;). The two are linked by the UUID.&lt;/p&gt;

&lt;p&gt;This allows the system to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load the structure without loading content.&lt;/li&gt;
&lt;li&gt;Load a note’s content by looking up its UUID in the appropriate content file.&lt;/li&gt;
&lt;li&gt;Load content for a list of notes without scanning the structure again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the link is by UUID, the content files are simple dictionaries. No complex mapping is needed.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. How This Enables Navigation
&lt;/h2&gt;

&lt;p&gt;Navigation (home screen, notebook view, subnotebook view) requires only &lt;code&gt;structure.json&lt;/code&gt;. The user sees a list of notes with titles, timestamps, and file indicators. None of that needs the actual content.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When the user opens a notebook, &lt;code&gt;structure.json&lt;/code&gt; is read. The notes list is built from the &lt;code&gt;notes&lt;/code&gt; array. The content of the notes is &lt;strong&gt;not loaded&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;When the user scrolls through the list, only the &lt;code&gt;structure.json&lt;/code&gt; data is used.&lt;/li&gt;
&lt;li&gt;The lock button can unload &lt;code&gt;structure.json&lt;/code&gt; when locking a notebook, freeing memory. The content files are not even loaded, so no memory is wasted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If structure and content were combined, unlocking a notebook would load all content automatically, increasing memory footprint and startup time.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. How This Enables Git History
&lt;/h2&gt;

&lt;p&gt;Git commits record changes to these files individually. Because they are separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A commit that renames a note touches only &lt;code&gt;structure.json&lt;/code&gt;. The content file remains unchanged.&lt;/li&gt;
&lt;li&gt;A commit that edits a note touches only &lt;code&gt;notes.json&lt;/code&gt;. The structure file remains unchanged.&lt;/li&gt;
&lt;li&gt;A commit that deletes a note touches &lt;code&gt;structure.json&lt;/code&gt; (to remove the entry) and the appropriate content file (to remove the mapping). The two changes are in separate files, but they are part of the same commit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation means that when you view the history of a note, the &lt;code&gt;git log&lt;/code&gt; command can be scoped to &lt;code&gt;notes.json&lt;/code&gt;. It does not need to filter through commits that only changed structure. Conversely, activity view for a notebook (showing renames) can focus on &lt;code&gt;structure.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The commit messages embed the UUID and the action. Git does not need to parse the file content to understand what changed; the metadata is in the message.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. How This Enables Resurrection
&lt;/h2&gt;

&lt;p&gt;Resurrection requires reconstructing an item from a past commit. Because structure and content are separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The structure at a given commit is retrieved from &lt;code&gt;structure.json&lt;/code&gt; at that commit.&lt;/li&gt;
&lt;li&gt;The content is retrieved from &lt;code&gt;notes.json&lt;/code&gt; or &lt;code&gt;files.json&lt;/code&gt; at the same commit.&lt;/li&gt;
&lt;li&gt;The UUID links the two.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the files were combined, reconstructing a single note would require loading the entire monolithic file and extracting the relevant parts. With separation, only the necessary parts are loaded: the structure entry for the note and its content entry.&lt;/p&gt;

&lt;p&gt;The timeline engine uses this to reconstruct only the requested item, not the whole notebook.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. How This Enables Precise Deletion with &lt;code&gt;git‑filter‑repo&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;When erasing a note, &lt;code&gt;git-filter-repo&lt;/code&gt; is told to operate only on &lt;code&gt;structure.json&lt;/code&gt;, &lt;code&gt;notes.json&lt;/code&gt;, and &lt;code&gt;files.json&lt;/code&gt;. Because the content is separate from the structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Removing a note requires removing its entry from &lt;code&gt;structure.json&lt;/code&gt; and its key from &lt;code&gt;notes.json&lt;/code&gt; (or &lt;code&gt;files.json&lt;/code&gt;). Both are in separate files.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;UUIDEraseFilter&lt;/code&gt; can target these specific files, leaving other files untouched.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the data were combined, erasing a note would require rewriting a single large file, potentially affecting other notes in the same file. Because of the separation, the operation is scoped and safe.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. How This Enables Restoration
&lt;/h2&gt;

&lt;p&gt;Restoration is the inverse of deletion. When a note is restored:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The structure entry is added back to &lt;code&gt;structure.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The content entry is added back to &lt;code&gt;notes.json&lt;/code&gt; (or &lt;code&gt;files.json&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The UUID is reused; no new ID is generated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because structure and content are separate, adding them back is a simple insertion. The restore process does not need to merge two different file formats; it just appends to the appropriate JSON dictionaries and writes the files.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. How This Enables Memory Efficiency
&lt;/h2&gt;

&lt;p&gt;When a notebook is unlocked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;structure.json&lt;/code&gt; is read and parsed. This gives the entire note list (titles, timestamps, etc.) without loading any content.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;notes.json&lt;/code&gt; and &lt;code&gt;files.json&lt;/code&gt; are &lt;strong&gt;not read&lt;/strong&gt; until a note is viewed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a note is viewed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The appropriate content file is read and parsed.&lt;/li&gt;
&lt;li&gt;The entire dictionary is loaded, but only one note’s content is displayed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the user returns to the notebook list, the content dictionary can be discarded (in practice, it stays until the notebook is locked or the app exits, but it is not needed for the list). The structure remains in memory, but structure is small compared to content.&lt;/p&gt;

&lt;p&gt;If structure and content were combined, unlocking a notebook would load all content automatically, consuming memory proportional to the total size of all notes.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. How This Enables the Lock Button as Memory Manager
&lt;/h2&gt;

&lt;p&gt;Locking a notebook discards:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The parsed &lt;code&gt;structure.json&lt;/code&gt; (the note list).&lt;/li&gt;
&lt;li&gt;The parsed &lt;code&gt;notes.json&lt;/code&gt; and &lt;code&gt;files.json&lt;/code&gt; (if they were loaded).&lt;/li&gt;
&lt;li&gt;The encryption key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because structure and content are separate, locking can be selective. The system does not need to keep structure in memory once the notebook is locked; it can be reloaded from disk when unlocked again.&lt;/p&gt;

&lt;p&gt;If structure and content were combined, locking would either have to keep the combined structure in memory (wasting memory) or discard it entirely (requiring a full reload on unlock, which would reload all content as well). The separation allows fine‑grained control.&lt;/p&gt;




&lt;h2&gt;
  
  
  11. How This Enables Git Delta Efficiency
&lt;/h2&gt;

&lt;p&gt;Git stores each file independently. Because structure and content are separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;structure.json&lt;/code&gt; changes frequently but remains small (a few kilobytes). Git stores deltas for it.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;notes.json&lt;/code&gt; and &lt;code&gt;files.json&lt;/code&gt; grow over time but change only when their corresponding notes are edited. Each edit produces a small delta (the change in the encrypted blob, which Git compresses further).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If all data were in one file, every edit would change the entire file. Even with delta compression, the first edit after a large addition would create a large delta because the file would shift. Separation prevents this.&lt;/p&gt;




&lt;h2&gt;
  
  
  12. How This Enables Deterministic UUID‑Level Synchronisation
&lt;/h2&gt;

&lt;p&gt;The three‑file architecture is the foundation for the sync algorithm. Because each UUID has its own independent chain of commits grouped by UUID, the system can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collect commits per UUID&lt;/strong&gt; without parsing content. The commit message contains the UUID, and the raw blobs of the three files are captured as they are.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resolve conflicts by timestamp&lt;/strong&gt; for each UUID independently. Because notes are stored as key‑value pairs, changes to different UUIDs never interfere with each other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replay winning commits&lt;/strong&gt; by simply writing the raw encrypted blobs. Each commit is a complete snapshot of the three files. Writing the blobs overwrites only the changed UUID’s entry, leaving other UUIDs untouched.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preserve non‑conflicting edits&lt;/strong&gt; automatically. If one side added a note (UUID‑A) and the other side added a different note (UUID‑B), both chains are kept. The final state contains both notes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid merge commits entirely&lt;/strong&gt; because the sync algorithm rebuilds history on an orphan branch, never creating merge commits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If structure and content were combined, a single commit would contain changes to multiple UUIDs. Grouping by UUID would be impossible without parsing the entire file. Conflict resolution would require merging file contents, not just comparing timestamps. The sync algorithm would become as complex as Git’s own merge. The three‑file architecture makes UUID‑level sync possible and simple.&lt;/p&gt;




&lt;h2&gt;
  
  
  13. Why This Design Is the Foundation for Everything
&lt;/h2&gt;

&lt;p&gt;Without this separation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigation would require loading content.&lt;/li&gt;
&lt;li&gt;Git history would be a single file’s history, making it impossible to separate structure changes from content changes.&lt;/li&gt;
&lt;li&gt;Resurrection would require reconstructing a monolithic file.&lt;/li&gt;
&lt;li&gt;Deletion with &lt;code&gt;git-filter-repo&lt;/code&gt; would be imprecise and risk affecting unrelated data.&lt;/li&gt;
&lt;li&gt;Restoration would be a full‑file rewrite.&lt;/li&gt;
&lt;li&gt;Memory would be tied to total note count, not active use.&lt;/li&gt;
&lt;li&gt;The lock button could not unload structure independently of content.&lt;/li&gt;
&lt;li&gt;Git storage would grow much faster because each edit would rewrite the entire notebook state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synchronisation would be impossible&lt;/strong&gt; without complex file‑level merging, and per‑item conflict resolution would not exist.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation is not an implementation detail. It is the central architectural decision that enables every other feature:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Navigation&lt;/strong&gt; – uses structure only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git history&lt;/strong&gt; – separate files mean separate history streams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resurrection&lt;/strong&gt; – reconstruct by UUID from two separate files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Filter‑repo deletion&lt;/strong&gt; – target specific files, not the whole notebook.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restoration&lt;/strong&gt; – append to two separate files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory efficiency&lt;/strong&gt; – load structure without content, load content on demand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock button&lt;/strong&gt; – discard structure, content, and key independently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage efficiency&lt;/strong&gt; – small deltas for small changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synchronisation&lt;/strong&gt; – per‑UUID commit chains, timestamp‑based conflict resolution, linear history reconstruction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every feature you built rests on this single decision: keep the notebook’s blueprint separate from its contents, and link them by UUID. Without it, the system would be a conventional note‑taking app. With it, it becomes a versioned, memory‑efficient, resurrectable, securely erasable, and synchronisable knowledge base.&lt;/p&gt;

&lt;p&gt;This is why the three‑file architecture is the most important part of the codebase. It is not merely a storage format; it is the enabling structure for everything that follows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sys-ronin/terminal-notes/" rel="noopener noreferrer"&gt;terminal-notes - github&lt;/a&gt;&lt;br&gt;
&lt;a href="mailto:sys_ronin@protonmail.com"&gt;sys_ronin@protonmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;sys-ronin&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>distributedsystems</category>
      <category>ai</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>An example where AI/LLM is used to create an architecture under the architects strict instruction</title>
      <dc:creator>sys-ronin</dc:creator>
      <pubDate>Tue, 09 Jun 2026 19:59:23 +0000</pubDate>
      <link>https://dev.to/sys-ronin/a-python-terminal-writer-with-git-github-e2ee-sync-hardware-bound-keys-and-temporalsearch-po6</link>
      <guid>https://dev.to/sys-ronin/a-python-terminal-writer-with-git-github-e2ee-sync-hardware-bound-keys-and-temporalsearch-po6</guid>
      <description>&lt;p&gt;I am a 40 years old sysadmin with 25 years old system knowledge without any formal education (no cs degree) and no python experience.&lt;/p&gt;

&lt;p&gt;It is happened when i tried to design my note taking applications architecture Where I with my lack of formal education took a different path for building that (architecture) using AI/LLM.&lt;/p&gt;

&lt;p&gt;I accidentally built my own cognition just asking myself how i think. I just thought it will be a great idea if i follow my own thought process, how it remember everything without searching inside my head. Then later I found after a thorough research that it is something very rare incident, where i have designed an architecture what matches the theory of our human hippocampus. &lt;/p&gt;

&lt;p&gt;Though i created it for myself but I realised It is worthy enough to share the artefact built by AI/LLM and the discovery of what AI/LLM can do when instructed precisely with all its power. &lt;/p&gt;

&lt;p&gt;I found similarities where my every python modules works as various features, the notebook folder acts as the memory and the application as a whole works as the brain. Where it creates memory, remember memory, forgot memory, erase memory where uuid is used as engram.&lt;/p&gt;

&lt;p&gt;As it is accidentally built with my own cognition design (just like everybody else, same human brain), I found it does not need any learning curve and really helpful for writing, where I don't have to fight with the application for its distraction during writing.&lt;/p&gt;

&lt;p&gt;Some of its features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Only python 3.13, git and an editor is needed.&lt;/li&gt;
&lt;li&gt;No learning curve&lt;/li&gt;
&lt;li&gt;Unlimited notebooks/notes/files&lt;/li&gt;
&lt;li&gt;Temporal Search&lt;/li&gt;
&lt;li&gt;Git is used as item level versioning&lt;/li&gt;
&lt;li&gt;AES-GCM encryption&lt;/li&gt;
&lt;li&gt;Hardware bound movable vault without TPM&lt;/li&gt;
&lt;li&gt;USB drive can be used as vault.&lt;/li&gt;
&lt;li&gt;UI disappears while using&lt;/li&gt;
&lt;li&gt;Free conflict free sync using github&lt;/li&gt;
&lt;li&gt;App, Data and Keys can live separately&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The AI/LLM development methodology is not documented for its vastness.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sys-ronin/terminal-notes" rel="noopener noreferrer"&gt;terminal-notes - github&lt;/a&gt;&lt;br&gt;
&lt;a href="mailto:sys_ronin@protonmail.com"&gt;sys_ronin@protonmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repo is published as "prior art"&lt;/p&gt;

&lt;p&gt;sys-ronin&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>hci</category>
      <category>ai</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
