Resource Manager is an Oracle Cloud Infrastructure (OCI) service that lets you automate the process of provisioning your OCI resources. Using Terraform, Resource Manager helps you install, configure, and manage resources through the infrastructure-as-code (IaC) model.
A Terraform configuration codifies your infrastructure in declarative configuration files. Resource Manager lets you share and manage infrastructure configuration and state files across multiple teams and platforms. This infrastructure management can’t be done with local Terraform installations and Oracle Terraform modules alone.
Following are brief descriptions of key concepts and the main components of Resource Manager. For more information, see the service documentation.
Configuration: Information that codifies your infrastructure. A Terraform configuration can be a solution or a file that you write. You can upload your written file directly or store it in a source code control system.
Configuration source provider: Connection information to a source code control system in which your Terraform configuration files are stored. Use a configuration source provider to create a stack from a remote, versioned Terraform configuration file.
Drift: The difference between the actual state of your infrastructure and the stack’s last executed configuration. For example, drift occurs when a team member adds a production tag to your resources, or when a resource fails.
Job: Instructions to perform the actions defined in your configuration. Only one job at a time can run on a given stack, and you can have only one set of OCI resources on a given stack. Resource Manager provides the following job types: plan, apply, destroy, and import state.
Module: A group of related resources. Use modules to create lightweight and reusable abstractions so that you can describe your infrastructure in terms of its architecture.
Package: A zip file to a Terraform configuration that is stored in a supported provider, such as GitHub.
Resource discovery: A feature that captures deployed resources as Terraform configuration and state files. With this feature, you can move from manually managed infrastructure to Resource Manager-controlled infrastructure, learn how Terraform uses HashiCorp Configuration Language (HCL) syntax to represent OCI resources, and duplicate or rebuild existing infrastructure in another compartment.
Sample solution: An Oracle-provided, prebuilt Terraform configuration that provisions a set of resources used in a common scenario.
Stack: The collection of OCI resources corresponding to a given Terraform configuration. Each stack resides in the compartment that you specify, in a single region; however, resources on a given stack can be deployed across multiple regions. An OCID is assigned to each stack. You can create stacks from solutions, from remote or local Terraform configurations, or from existing compartments by using resource discovery.
The Oracle Cloud Development Kit preinstalls the following OCI items on a compute instance:
Instance principal authorization is set up for installed items and the provisioned compute instance. An upgrade script is also included.
To provision an instance with the development kit, follow these steps:
Instance Shape: Select the shape to use for the compute > instance.
Auto-Generate SSH Key Pair: To automatically generate an SSH key > pair for accessing the instance, select this option. The private > key is stored in the Terraform state file. To upload a public key > instead, don’t select the option. No private key is stored, so > keep the corresponding private key in a safe location. You use the > private key later to connect to the instance.
Compute Instance to Access All Resources at Tenancy Level: > Controls the level used for the dynamic group policy, which > determines what resources users of the compute instance can > access. Select this option to give users access to all the > resources in the tenancy. If you don’t select this option, users > have access only to the resources in the same compartment as the > instance.
Figure 2: Choosing a shape and other variables
The new stack appears in the Stack Details page.
After the stack is created, retrieve the instance’s private key to connect to the instance and perform any actions.
Note: When you connect to the instance, the private key file permissions are validated. For security, your private key must be accessible by the owner only; otherwise, you can’t connect to the instance. (Owner write permissions are required for you to add the private key to the file.) For UNIX or Linux, use the command
chmod`` 600 (-``rw``-------).
After you connect to the instance, you can use the installed development kit.
That’s how quickly you can provision an OCI development environment and get started with your OCI development tasks.
This post provided an overview of the Oracle Cloud Infrastructure Resource Manager and showed how to create a sample solution that helps you to create a development environment within Oracle Cloud Infrastructure itself by using Resource Manager.
Oracle Cloud Infrastructure provides Enterprise features for developers to build modern cloud applications. Try the Oracle Cloud Free Tier with 300$ credits for a 30 Day Free Trial. Free Tier also includes a number of “Always Free” services that are available for an unlimited period of time even after your free credits expire.