Oracle Resource Manager & Terraform
Resource Manager and Terraform
Resource Manager uses Terraform to help you provision, configure, and manage Oracle Cloud Infrastructure (OCI) resources. Each stack in Resource Manager is associated with a Terraform configuration and a Terraform state file. An understanding of Terraform concepts is critical to manage resources successfully with Resource Manager.
Terraform Configuration
Terraform configurations codify your infrastructure in declarative files that contain the steps required to provision your infrastructure and maintain its state. To manage OCI resources, the configuration must specify the terraform-provider-ociTerraform provider.
Resource Manager requires Terraform configurations to create stacks for provisioning and managing OCI resources. Pre-defined Terraform configurations are available as templates, and you can also generate Terraform configurations from existing compartments and from resource creation pages (such as Create compute instance). After the initial provisioning of your OCI resources, Resource Manager uses the stack’s Terraform configuration to detect drift of resources (the difference between resource states and the configuration).
For a walkthrough that includes writing a sample Terraform configuration, see Getting Started.
For information about writing our own Terraform configurations, see Terraform Configurations for Resource Manager and Authoring Configurations.
Terraform State
Terraform state files are automatically generated and updated by Resource Manager. Resource Manager stores Terraform state files for stacks so you don't have to. The stack's state file (.tfstate, in JSON format) maps your stack's resources to your configuration and maintains essential configuration metadata, such as resource dependencies.
Multiple people can work on a stack concurrently because stack state is locked, allowing only one job at a time to run on a given stack.
For related instructions, see:















