Create a Compute Instance

Use Terraform to create a compute instance in your Oracle Cloud Infrastructure tenancy.

Key tasks include how to:

  • Create SSH keys.
  • Create a virtual cloud network in your tenancy.
  • Use Oracle Cloud Infrastructure Terraform provider to create a compute instance in the network.
  • Connect to your instance.
A diagram of the components needed to create an Oracle Cloud Infrastructure compute instance with Terraform. The compute instance is created in a public subnet of a virtual cloud network. The public subnet is connected to the insternet through an internet gateway.

For more information, see:

Before You Begin

To successfully perform this tutorial, you must have the following:

1. Prepare

Prepare your environment for creating a compute instance. Also, collect all the information you need to complete the tutorial.

2. Create Scripts

Create scripts for authentication, fetching data, creating a compute instance, and printing outputs.

3. Run Scripts

Run your Terraform scripts to create the compute instance in a compartment in your tenancy. Use your SSH keys to connect to the instance. When you no longer need your instance, destroy it with Terraform.