A Terraform configuration for compute resources on the Free Tier of Oracle Cloud Infrastructure.
Deploys a minimal set of resources to run a compute instance on the OCI Free Tier.
For simplicity—to avoid the need to install and configure Terraform and the OCI CLI—this configuration is designed for deployment as a stack in the OCI Resource Manager. Resource Manager offers two options for doing so: quick-create link (recommended) and manual deployment. Regardless of which option you choose, begin with the following steps and then proceed to either Quick-Create Link or Manual Deployment below.
- Log into the Oracle Cloud Infrastructure Console.
- Ensure that your browser session is in your tenancy’s root compartment:
- From the hamburger menu (horizontal stripes) on the upper left, find Identity & Security → Identity and click on Compartments.
- On the Compartments page, click on the name of your tenancy under the Name column. If you have done so successfully, the Compartment Details page should show the following description:
The root Compartment of the tenancy
- Open the following link in your browser: https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/RhubarbSin/terraform-oci-free-compute-minimal-example/archive/refs/tags/v0.2.0.zip
- On the Create stack page, select the check box labeled “I have reviewed and accept the Oracle Terms of Use.”
- Click on the Next button and provide an SSH public key.
- Click Next again.
- Click on the Create button.
- Wait for the submitted job to complete and proceed to Next Steps below if the job reaches the SUCCEEDED state. Otherwise, proceed to Final Steps below.
- Download the repository as a ZIP file: on the repository’s GitHub page, choose Download ZIP from the Code menu on the upper right.
- Go to the Resource Manager: from the hamburger menu, find Developer Services → Resource Manager and click on Stacks.
- Click on the Create Stack button, select .zip file under the Stack Configuration heading, and select the downloaded ZIP file via the Browse link.
- Click on the Next button and provide an SSH public key.
- Click Next again.
- Select the check box labeled “Run apply” under the Run apply on the created stack? heading and click on the Create button.
- Wait for the submitted job to complete and proceed to Next Steps below if the job reaches the SUCCEEDED state. Otherwise, proceed to Final Steps below.
- From the hamburger menu, find Compute → Compute and click on Instances.
- Information for connecting to the instance with SSH can be found by clicking on the instance (named OCI Free Compute Minimal by default) and viewing the details under the Instance access heading on the Instance information tab.
Regardless of whether the deployment succeeds—it may fail because of inadequate capacity of AMD Flex instances for accounts on the free tier, for example—you will probably want to delete the stack’s resources and the stack itself.
- To destroy the resources, navigate back to Resource Manager » Stacks » Stack Details and click on the Destroy button and click Destroy again.
- To delete the stack, after the destroy job completes, from the Resource Manager » Stacks » Stack Details » Job Details page go to Resource Manager » Stacks. From the kebab menu (vertical dots) on the far right for the stack, choose Delete and click on the Delete button.
The resources deployed include the following:
- One (1) Virtual Cloud Network
- One (1) Internet Gateway
- One (1) Subnet
- One (1) AMD Micro instance running the latest Oracle Linux distribution with the following specifications:
- 1 OCPU
- 1 GiB of memory
- 47 GiB of storage
- 1 public IP address