Skip to content

Example of Terraform configuration for minimal compute resources on OCI's Free Tier

License

Notifications You must be signed in to change notification settings

RhubarbSin/terraform-oci-free-compute-minimal-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-oci-free-compute-minimal-example

What it is

A Terraform configuration for compute resources on the Free Tier of Oracle Cloud Infrastructure.

What it does

Deploys a minimal set of resources to run a compute instance on the OCI Free Tier.

How to use it

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.

  1. Log into the Oracle Cloud Infrastructure Console.
  2. Ensure that your browser session is in your tenancy’s root compartment:
    1. From the hamburger menu (horizontal stripes) on the upper left, find Identity & SecurityIdentity and click on Compartments.
    2. 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
              

Quick-Create Link

  1. 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
  2. On the Create stack page, select the check box labeled “I have reviewed and accept the Oracle Terms of Use.”
  3. Click on the Next button and provide an SSH public key.
  4. Click Next again.
  5. Click on the Create button.
  6. 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.

Manual Deployment

  1. Download the repository as a ZIP file: on the repository’s GitHub page, choose Download ZIP from the Code menu on the upper right.
  2. Go to the Resource Manager: from the hamburger menu, find Developer ServicesResource Manager and click on Stacks.
  3. Click on the Create Stack button, select .zip file under the Stack Configuration heading, and select the downloaded ZIP file via the Browse link.
  4. Click on the Next button and provide an SSH public key.
  5. Click Next again.
  6. Select the check box labeled “Run apply” under the Run apply on the created stack? heading and click on the Create button.
  7. 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.

Next Steps

  1. From the hamburger menu, find ComputeCompute and click on Instances.
  2. 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.

Final Steps

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.

  1. To destroy the resources, navigate back to Resource Manager » Stacks » Stack Details and click on the Destroy button and click Destroy again.
  2. 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.

Details

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